The Syrian 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 said on Monday.
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.
"A provisional translation by an interpreter shows that he expressly announces, in the name of Allah, and testifying his allegiance to (Islamic State leader) Abu Bakr al-Baghdadi ... an act of revenge against the Germans because they're getting in the way of Islam," Bavarian Interior Minister Joachim Herrmann told a news conference.
"I think that after this video there's no doubt that the attack was a terrorist attack with an Islamist background."
Islamic State claimed responsibility for the bombing, according to Amaq, a news agency that supports Islamic State.
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.
The attack on Sunday, outside a music festival in Ansbach, a town of 40,000 people southwest of Nuremberg that has a U.S. Army base, was the fourth act of violence by men of Middle Eastern or Asian origin against German civilians in a week.
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.
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.
The incident, after three other attacks since July 18 that left 10 people dead and dozens injured, will fuel growing public unease about Chancellor Angela Merkel's open-door refugee policy. More than a million migrants entered Germany over the past year, many fleeing war in Afghanistan, Syria and Iraq.