A suspected suicide bomber has killed himself and injured 12 others, three seriously, in an explosion outside a wine bar in the German city of Ansbach.

Detectives have said the attacker was a 27-year-old Syrian man who had been denied asylum in Germany.

Security officials say he detonated an explosive device after being turned away from a music festival being attended by thousands of people because he didn't have a ticket.

Image: The pack used to carry an explosive device in Ansbach

Joachim Herrmann, Bavaria's interior minister, said the contents of his backpack had the potential to kill and injure many more victims as they included both explosives and metal parts.

A spokesman for Germany's interior ministry said the danger of an attack remained high.


:: Germany Rocked By Week Of Bloody Violence

"Due to the situation in Syria, he was not deported. In spite of the rejected application, he was given exceptional leave to remain," Mr Herrmann said.

Interior ministry spokesman Tobias Plate said there had been a continued intention to deport the man.

"Syrians cannot be deported to Syria at the moment, but that doesn't mean that Syrians overall cannot be deported," he said at a news conference.

"The Syrian in Ansbach was facing deportation and this was to Bulgaria" (where he had first submitted a request for asylum).

Mr Plate said the suspect had received two deportation notices, most recently on 13 July.

Image: Police officers leave after a search at a refugee shelter in Ansbach

The suspect was known to the authorities and had repeatedly received psychiatric treatment, including for attempted suicide.

"We don't know if this man planned on suicide or if he had the intention of killing others," Mr Herrmann said.

"My personal view is that I unfortunately think it's very likely this really was an Islamist suicide attack," he told German news agency dpa.

"The obvious intention to kill more people indicates an Islamist connection."

But a spokesman for the prosecutor's office in Ansbach, Michael Schrotberger, took a more cautious line.

"If there is an Islamist link or not is purely speculation at this point," he said.

Image: The blast happened near a bar in central Ansbach

A large-scale operation involving 200 police and 350 rescue workers was launched, and a helicopter brought in.

Armed police have raided a building used to house asylum seekers three kilometres from the scene.

Detectives have asked anyone with mobile phone footage to send it in.

Witness Thomas Debinski said: "People were definitely panicking. The rumour we were hearing immediately was that there had been a gas explosion.

"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."

More than 2,000 people were evacuated from the nearby festival.

Germany has been on high alert following a series of incidents in recent days.

On Sunday, a Syrian refugee wielding a machete killed a woman and injured two other people in the German city of Reutlingen. The 21-year-old man was apparently acting alone and has been arrested.

And on Friday, nine people were killed in a shooting near a shopping centre in Munich, which was carried out by an 18-year-old who later turned the gun on himself.