A failed Syrian asylum seeker has blown himself up and injured 12 other people with a backpack bomb near a festival in the south German town of Ansbach.
The state of Bavaria's interior minister said the 27-year-old man had detonated the device after being refused entry to the music festival.
About 2,500 people were evacuated from the venue after the explosion.
Bavaria has been on edge since a knife rampage on a train claimed by so-called Islamic State last Monday.
In that attack, in Wuerzburg, an axe-wielding Afghan asylum seeker teenager was shot dead after injuring five people.
A shooting rampage in the state capital, Munich, on Friday left nine people dead but police are not treating it as a terrorist attack.
The Ansbach blast is reported to have happened at about 22:10 (20:10 GMT) 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.
Three of the injured were in a serious condition, police said.
Security services have sealed off the city centre and experts are trying to establish the kind of explosives the bomber used.
The dead 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 an apartment in Ansbach, Mr Herrmann added.
The minister said he was "incensed" by the attack which, he said, demonstrated the need to "strengthen controls on those we have living in our country".
Mr Herrmann said the man had been known to have attempted suicide 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.
However, he added that the bomb in the backpack would have been sufficient to kill and injure many more people.
Ansbach deputy police chief Roman Fertinger said there were "indications" that pieces of metal had been added to the explosive device.
Witness Thomas Debinski said there was "panic" after the explosion, although some people 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.
"After what just happened in Munich it's very disturbing to think what can happen so close to you in such a small town."