Update 6.11pm: The so-called 'Islamic State' group has claimed responsibility after a Syrian blew himself up outside a wine bar in Ansbach, injuring 15 people.
Update 3.17pm: Bavaria's top security official has said a video has been found on the Ansbach bomber's phone showing him pledging allegiance to the leader of the co-called 'Islamic State' group.
Joachim Herrmann said that according to an initial translation of the Arabic-language video the 27-year-old man announced a "revenge" attack against Germany.
Mr Herrmann told reporters the video strongly suggests the bombing was a "terrorist attack".
Officials also said police found violent videos and bomb-making material at his home.
Mr Herrmann said officers discovered videos with "Salafist content" on storage devices seized at the Syrian man's home.
He told reporters police also found gasoline, chemicals and other material that could be used to make a bomb.
A Syrian suicide bomber who blew himself up after being turned away from a music festival in southern Germany was driven by religious extremism to kill others, an official has suggested.
Bavarian interior minister Joachim Herrmann said his view was that "it's very likely this really was an Islamist suicide attack" with a clear intention to cause multiple casualties.
He said that while no concrete evidence had been found of the 27-year-old having links to the so-called 'Islamic State' group, the possibility could not be ruled out.
The attacker, who has not been named, killed himself and injured 12 other people, three of them seriously, when he detonated an explosive device outside a restaurant in central Ansbach on Sunday evening.
"The obvious intention to kill more people indicates an Islamist connection," Mr Hermann told German news agency dpa.
The man had repeatedly received psychiatric treatment, including for attempted suicide, and was known to authorities, he said.
It is thought the attacker was carrying the bomb in a rucksack which contained sharp bits of metal, and Roman Fertinger, the deputy police chief in nearby Nuremberg, said it was likely there would have been more casualties if he had not been barred from the festival.
Around 2,500 people were evacuated from the nearby event where the attacker, who had been in Germany for more than a year, had earlier tried to gain entry.
The attack comes as Germany reels from Friday's massacre in Munich that left nine dead and dozens injured.
It is the third attack to hit Bavaria in a week, following an 'IS'-inspired axe rampage by a teenager on Monday.
The final night of the three-day Ansbach Open music festival in the heart of the city, around 90 miles north of Munich, was under way on Sunday evening when the chaos began.
Bavaria police said security at the event, held at the Reitbahn near the city's castle, noticed a young man acting suspiciously in the area at around 9.45pm.
The force said in a statement: "The person was a young man, who carried a backpack and walked up and down the area next to the entrance at the Pfarrstrasse for a long period of time.
"Afterwards he made his way to the outdoor seating area of a restaurant. At around 10.10pm an explosion happened there (at the restaurant), after the young man briefly bent forwards."
Bystanders thought there had been a gas explosion at a nearby restaurant in the aftermath of the blast.
Witness Thomas Debinski described the "disturbing" scene in the small city as bystanders came to realise a violent act had taken place.
"People were definitely panicking, the rumour we were hearing immediately was that there had been a gas explosion," he told Sky News.
"But then people came past and said it was a rucksack that had exploded. Someone blew themselves up. After what just happened in Munich it's very disturbing to think what can happen so close to you in such a small town."
The concert was shut down and around 200 police officers and 350 rescue personnel flooded the scene, with investigators later confirming the blast had been caused by a bomb.
Mr Herrmann said the suspect was a Syrian whose application for asylum had been rejected, but he had been allowed to stay in Germany due to the civil war.
He had been living in Ansbach since July 2 and was known to the authorities after committing two offences. He had also tried to commit suicide twice, police said.
In January a programme was launched in the city to help refugees assimilate by teaching them the basics of law in their new host country.
The initiative came amid growing tensions and concerns in Germany over the large numbers of migrants, and taught lessons on freedom of opinion, the separation of religion and state and the equality of men and women.
Police are yet to release more details on the attacker and he has not been named.
Michael Schrotberger, a spokesman for the prosecutor's office in Ansbach, said his motives remained unclear.
"If there is an Islamist link or not is purely speculation at this point," he said.
Investigators have appealed for any mobile phone footage taken at the scene of the attack, following similar appeals by Munich detectives who made their first arrest in connection with Friday's atrocity on Sunday.
The latest incident will add to a feeling of grief and insecurity in a country rocked by a spate of violent extreme acts.
Last Monday, a 17-year-old Afghan asylum seeker launched an axe and knife attack on passengers on a train in Wuerzburg.
'Islamic State' claimed responsibility for the attack in which five people were injured.
The teenage axeman, Riaz Khan Ahmadzai, was shot dead by police.
On July 14, more than 80 lives were lost when a lorry ploughed into crowds watching a Bastille Day firework display in Nice, France.
'IS' said it was also responsible for the attack by 31-year-old Mohamed Lahouaiej Bouhlel.
Earlier on Sunday, a Syrian asylum seeker killed a woman with a machete and wounded two others outside a bus station in the south-western German city of Reutlingen before being arrested.
Witnesses said the 21-year-old man, who was known to police, was having an argument with the woman before attacking her.
Police said the motive behind the attack is still not clear.