A suspected member of the Islamic State (IS) group has killed 10 people, at least eight of them German tourists, in a suicide bomb attack in the Turkish city of Istanbul, officials say.
They say the Syrian national carried out the attack in the Sultanahmet district, near the famous Blue Mosque.
Fifteen people were wounded, many of them also German.
President Recep Tayyip Erdogan said Turkey was the "top target for all terrorist groups in the region".
Turkish Prime Minister Ahmet Davutoglu said: "We have determined that the perpetrator of the attack is a foreigner who is a member of Daesh [IS]."
Analysis: BBC's Paul Wood in Istanbul
The shops and restaurants around the Blue Mosque are open tonight but deserted - no surprise when the German government has warned its tourists to stay away from crowded open areas.
The Turkish government now firmly believes this was an attack by the so-called Islamic State - a reflection of Turkish foreign policy, with Turkey an increasingly active part of the US coalition against IS.
One source said Turkey had taken the lead recently at a meeting of anti-IS armed groups on the Syrian border. IS has been losing territory in Iraq and in Syria. The Syrian town of Manbij may be next to fall - there are reports of IS commanders pulling out.
As IS comes under pressure, it has warned of more attacks against its enemies - not only in Turkey, but in Europe and the US.
German Chancellor Angela Merkel confirmed the deaths of at least eight German nationals.
"I mourn for our compatriots and express my sympathy for the relatives. They now have to live with the terrible pain of knowing that a loved one will not return," Ms Merkel said.
She added: "International terror chooses different locations for its attacks but the target is always the same: our free life in free societies... It is precisely this freedom and our determination together with our international partners to act against these terrorists, that will go on."
Turkey's Deputy PM Numan Kurtulmus said the suicide bomber had been identified as a Syrian. The suspect, said to have been born in 1988, was identified from body parts. Some Turkish media said the suspect was born in Saudi Arabia.
Mr Kurtulmus said the suspect was not on Turkey's militant watch-list and was believed to have recently crossed into Turkey from Syria.
Turkey last year took a more active role against IS in Syria, carrying out air strikes and allowing US warplanes to use its Incirlik base for missions.
Eyewitness Murat Manaz said: "It was a suicide bomb. I went there and saw it and came back to the hotel. There was chaos. Everybody was running somewhere.
"Policemen did not see this coming. They were distressed but at the same time they were trying to evacuate the area because they said there was a possibility that a second bomb could go off."
Bishop Pat Buckley, from Northern Ireland, had been taking photos in Sultanahmet Square shortly before the blast and had moved on into the Blue Mosque.
He told the BBC: "I have lived in Northern Ireland since the 70s, and I have heard explosions, and this was incredibly loud. I saw dust through the doorway of the mosque and I could smell the explosives."
He added: "I am slightly worried because there is talk here that they are expecting further trouble and we have been warned to avoid crowds."
One Norwegian was confirmed among the injured.
Germany currently provides the largest number of tourists visiting Turkey. In 2014, 23.6 million people visited, with the top three:
- Germans - 5.1 million (21.5%)
- Russians - 3.7 million (15.6%)
- Britons - 1.5 million (6.3%)
What is the security situation in Turkey?
Turkey faces many security threats and establishing which group is behind this latest attack will be a matter of urgency. The Islamic State group has been blamed for three bombings in Turkey in the past year, including an attack in Ankara that killed more than 100 people. Violence has also soared between Turkish security forces and PKK militants, battling for more autonomy for the Kurds, after a ceasefire agreement broke down in July. A PKK offshoot, the TAK, fired a mortar at Istanbul airport last month. Far left groups are also active in Turkey, and a female suicide bomber attacked a police station in Istanbul's Sultanahmet district last year.
Who could be behind the latest attack?
President Erdogan has blamed a "suicide bomber of Syrian origin". The conflict in Syria has not only seen the rise of IS but also strengthened the PKK's offshoot in Syria, known as the YPG. There was no immediate claim of responsibility, but correspondents point out that IS was similarly silent following previous attacks last year that were widely blamed on the jihadist group.
How is the Turkish government responding?
Last year Turkey agreed to take a more active role in the US-led campaign against IS, carrying out air strikes in Syria. It also allowed US warplanes to strike IS targets from its base in Incirlik and moved to tighten security along its 900km (560 mile) border with Syria. Meanwhile Turkish forces have also been targeting Kurdish militants in northern Iraq. And violence has flared in Turkey's mainly Kurdish south-east, where the Turkish military says it has killed some 600 PKK militants over the past month, according to Anadolou Agency.