A Syrian man who blew himself up injuring 12 people outside a music festival in the south German town of Ansbach was previously known to police for suicide attempts and drug offences, authorities said.
The 27-year-old detonated a rucksack bomb at the entrance to the music festival after being denied entry.
The man, who has not yet been named, had been living in Germany for two years and had spent time at a psychiatric hospital in Ansbach.
Last year his application for asylum was rejected by German authorities, though due to the civil war in Syria he had been allowed to stay in Germany.
Police have not yet ruled out the possibility of a terrorist motive.
Three of the people injured are in a critical condition, police said.
On Monday, armed police were seen at two addresses the man had lived at looking for evidence.
At a news conference early on Monday morning, Bavarian interior minister Joachim Herrmann said the backpack had been filled with sharp pieced of metal used in “wood manufacturing”, and could have killed many more people.
He said it was unclear whether the man had planned only a suicide attack or whether he wanted to kill more people, but added that it appeared to me more than just a “pure suicide attempt”.
“It’s terrible,” Mr Herrmann said, “that someone who came into our country to seek shelter has now committed such a heinous act and injured a large number of people who are at home here, some seriously.”
“It’s a further, horrific attack that will increase the already growing security concerns of our citizens. We must do everything possible to prevent the spread of such violence in our country by people who came here to ask for asylum.”
The explosion is the third attack on Bavarian civilians in the past week, after a teenager with an axe and a knife attacked people on a train last Monday, and on Friday an attack in Munich by an 18-year-old gunman left nine people dead.