A failed Syrian asylum seeker has blown himself up and injured 15 other people with a backpack bomb near a festival in the south German town of Ansbach.
The 27-year-old man, who faced deportation to Bulgaria, detonated the device after being refused entry to the music festival, Bavarian officials say.
About 2,500 people were evacuated from the venue after the explosion.
It is the third violent attack in Bavaria in a week. The state's premier described it as "days of horror".
Bavaria has been on edge since a knife attack on a train last week that so-called Islamic State (IS) said it was behind.
On Friday a gun attack killed nine in Munich.
The Ansbach blast took place at 22:10 (20:10 GMT) on Sunday evening, outside the Eugens Weinstube bar in the centre of the town, which has a population of 40,000 and is home to a US military base.
The bomb went off close to the entrance to the Ansbach Open music festival.
A witness, Thomas Debinski, reported "panic" after the explosion, although some people had thought it was caused by a gas explosion.
"Then people came past and said it was a rucksack that had exploded," he told Sky News.
The town's mayor, Carla Seidel, confirmed that there were 15 injured, four of them in a serious condition.
Security services have sealed off the city centre and experts are trying to establish the kind of explosives the bomber used.
In other developments
- The mayor of Munich, Dieter Reiter, suggested backpacks might be banned from the Oktoberfest beer festival as a security precaution
- An Afghan teenager arrested by Munich police met gunman David Sonboly shortly before he killed nine people and knew that he had a gun, German police say
- An MP from Chancellor Merkel's party, Stephan Mayer, called for Germany to regain control over its own borders but insisted it was wrong to blame "Angela Merkel and her refugee policy" for last week's violence
Seven deadly days
A week of bloody attacks has frayed nerves in Germany, which led the way in accepting asylum seekers from Syria. To date, only the first has been linked to a militant group:
- 18 July: An axe-wielding teenage asylum seeker from Afghanistan is shot dead after injuring five people in an attack on a train. IS claims the attack, releasing a video recorded by the attacker before the incident
- 22 July: A German teenager of Iranian extraction goes on a shooting rampage in the Bavarian state capital, Munich, killing nine people, most of them migrants, before shooting himself. He is said to have been obsessed with school shootings
- 24 July: A Syrian asylum seeker is arrested in the town of Reutlingen, Baden-Wuerttemberg, after allegedly killing a Polish woman with a machete and injuring two other people. Police suggest it was probably a "crime of passion"
- 24 July: A failed Syrian asylum seeker blows himself up outside a music festival in the small Bavarian town of Ansbach, injuring 12 other people. Motive not immediately clear
The Syrian man entered Germany two years ago and had his asylum claim rejected a year ago, Bavarian Interior Minister Joachim Herrmann said.
He had been given leave to stay temporarily given the situation in his home country and provided with accommodation in Ansbach, Mr Herrmann added.
A federal interior ministry spokesman, Tobias Plate, confirmed the man had faced deportation to Bulgaria.
"Syrians cannot at the moment be deported to Syria, but that doesn't mean that Syrians overall cannot be deported," he told reporters in Berlin.
Mr Herrmann said he was "incensed" by the attack which, he continued, demonstrated the need to "strengthen controls on those we have living in our country".
The Syrian asylum seekers rejected by Germany
Germany has been the main destination of Syrian asylum seekers entering the EU, most of them arriving irregularly in Greece via Turkey.
Only 23 Syrians had their applications for asylum rejected by the country last year, out of a total of 105,620 decisions on Syrians' applications. A common reason for rejecting an application is when the asylum seeker submits false or incomplete information.
Just under half of asylum seekers rejected by Germany in the past two years were allowed to stay on in the country, according to a recent report in German daily Die Welt (in German).
The Ansbach bomber, who was among those rejected for asylum in 2015, appears to have been placed in a former hotel in the town, designated by the municipal authorities for asylum seekers since 2014.
Source of statistics: German Federal Office for Migration and Refugees report (in German)
Ansbach deputy police chief Roman Fertinger said there were "indications" that pieces of metal had been added to the explosive device.
"The obvious intention to kill more people indicates an Islamist connection," Mr Hermann said.
'He told lies so often'
Mr Herrmann said the man had been known to have tried to take his own life twice and had spent time in a psychiatric clinic.
"We don't know if this man planned on suicide or if he had the intention of killing others," he said.
A resident of the former Ansbach hotel where the bomber had lived, Alireza Khodadadi, told the Associated Press news agency that he had occasionally drunk coffee with the Syrian, whom he named only as Mohammed, and they had discussed religion.
Mohammed, he said, told him IS was not representative of Islam: "He always said that, 'No, I'm not with them, I don't like them and such stuff.'
"But I think he had some issues because, you know, he told lies so often without any reason, and I understand that he wants to be in the centre of [attention], you know, he needed [attention],'' Mr Khodadadi added.
Are you in the area? Have you been affected by the incident? Tell us your experiences by emailing email@example.com.
You can also contact us in the following ways: