The Syrian who blew himself up near a music festival in southern Germany was acting on behalf of ISIL, the militant group’s Amaq agency claims.
Bavaria’s Interior Minister, Joachim Hermann, said the man had pledged allegiance to the self-styled Islamic State in a video on his mobile.
The 27-year-old promised vengeance against Germans who opposed Islam.
Earlier, Germany’s interior ministry said the man was facing deportation to Bulgaria.
“Syrians cannot at the moment be deported to Syria at the moment, but that doesn’t mean that Syrians overall cannot be deported,” spokesman Tobias Plate told a regular news briefing.
“The Syrian in Ansbach was facing deportation and this was to Bulgaria,” he said.
Police have been searching the converted hotel that is now a shelter for asylum seekers.
The Interior Minister Thomas de Maizière has warned against “general suspicions” towards refugees, adding that it is too early to decide on eventual changes to Germany’s refugee policy.
His Bavarian counterpart has said the Ansbach suicide bomber detonated a backpack device after being refused entry to the festival in the southern city.
The minister said the Syrian arrived in Germany two years ago and had been in trouble with local police for drug-taking and other offences. The dead man had reportedly been in treatment after twice before trying to kill himself.
The attack injured twelve people, three seriously, and forced the evacuation of more than 12,000 people from the event. It was the fourth attack on members of the public in Germany in a week. Three have been carried out by asylum seekers.
A shooting rampage in Munich on Friday left nine dead while earlier an axe-wielding teenager injured four people on a train in Wuerzburg.