A Syrian man who blew himself up in southern Germany, wounding 15 people, had pledged allegiance to Islamic State on a video found on his mobile phone, the Bavarian interior minister says.
Joachim Herrmann said that according to a provisional translation of the video the man testified allegiance to Islamic State leader Abu Bakr al-Baghdadi and announced an "act of revenge" against Germans.
"I think that after this video there's no doubt that the attack was a terrorist attack with an Islamist background," Mr Herrmann told a news conference.
The attacker killed himself and inured 15 others when he detonated a bomb outside a music festival in Ansbach, a town of 40,000 people southwest of Nuremberg.
The 27-year-old arrived in Germany two years ago and claimed asylum, a federal interior ministry spokesman said. He had been in trouble with police repeatedly for drug-taking and other offences and had faced deportation to Bulgaria.
On searching the bomber's room, Nuremberg police found diesel, hydrochloric acid, alcohol, batteries, paint thinner and pebbles - the same materials used in the bomb - and computer images and film clips linked to the militant group, they said.
Nuremberg police chief Roman Fertinger said the influence of Islamic State could be seen on the bomber's computer. "There was also a laptop that showed pictures and film sequences that glorify violence and are unequivocally linked to Islamic State," he told a news conference.
Mr Fertinger added that police had arrested a suspect who knew the bomber. They were trying to find out if the attacker had help making the bomb and whether it exploded prematurely, which could suggest he wanted to kill as many people as possible.
It was the second violent incident in Germany on Sunday and the fourth in the past week, including the killing of nine people by an 18-year-old Iranian-German gunman in the Bavarian capital Munich on Friday.
Earlier on Sunday, a 21-year-old Syrian refugee was arrested after killing a pregnant woman and wounding two people with a machete in the southwestern city of Reutlingen, near Stuttgart.
A week ago a 17-year-old youth who had sought asylum in Germany was shot dead by police after wounding five people with an axe near Wuerzburg, also in Bavaria. He was initially thought to be Afghan but federal Interior Minister Thomas de Maiziere has since said he may have been from Pakistan.
The latest violent incident is likely to fuel growing public unease about Chancellor Angela Merkel's open-door refugee policy. More than 1 million migrants entered Germany over the past year, many fleeing war in Afghanistan, Syria and Iraq.
Federal Interior Minister Thomas de Maiziere said no decision would be made on changing asylum or immigration rules until investigations into the recent incidents are finished.
"Of course I would and will initiate appropriate amendments if they are necessary or if I think they are necessary, but only then," he said.
Germany's federal and state security authorities have more than 400 leads on fighters or members of Islamist organisations among refugees in the country, the BKA federal police said.
The suicide bomber had been denied entry to the Ansbach Open music festival shortly before detonating the bomb outside a restaurant, Herrmann said. More than 2,000 people were evacuated from the festival after the explosion, police said.
Ansbach prosecutor Michael Schrotberger said the attacker had suffered episodes of depression. Fertinger, the Nuremberg police chief, said he had made superficial suicide attempts by cutting his arms, resulting in him receiving psychiatric care.