A SYRIAN migrant who killed himself and injured 12 others after setting off a bomb in front of a wine bar in Germany recorded a video on his phone pledging allegiance to ISIS.

The attacker, who was due to be deported to Bulgaria, also had violent videos on his phone in one of which he committed himself to the Islamic State's leader.

13 Injuries ... Medical crew were called in to help the injured

13 Quick response ... There were fears the bomber was targeting a nearby festival Credit: AP

The bomber, who was denied asylum in the country last year, had originally tried to get into a music festival hosting 2,500 people in the southern city of Ansbach - but was turned away as he had no ticket.

After being turned away the bomber walked to a nearby bar in the centre of Ansbach to set off the deadly device, which was packed with metal.

It has now emerged that the bomber was due to be deported to Bulgaria from Germany.

The attacker is being named locally as Mohamed Deleel and was already known to police for possession of drugs and also spent time in a psychiatric facility having attempted suicide twice before.

Residents at the man's asylum shelter have described him as a "lying attention seeker".

Three people are seriously injured after the horror blast at around 10pm last night- which came as Germany remains on high alert following three other violent attacks in the country.

Some 2,500 concert-goers were evacuated from the nearby folk festival following the blast and the gig was cancelled.

Emergency services were scrambled to the scene, including armed cops and helicopters.

Related stories MORE CARNAGE IN GERMANY Syrian refugee hacks pregnant woman to death before hero runs him over with his BMW OBSESSION OF A KILLER Munich murderer 'was obsessed by Anders Breivik and had him as WhatsApp profile pic' Latest HE PLOTTED ATROCITY FOR A YEAR Afghan friend of Munich gunman arrested over suspected role in plot Video 'YOU'RE A C*** IS WHAT YOU ARE' Watch gunman's furious exchange with bystander on roof of car park burnt to death Pregnant teen tortured by in-laws in Afghan 'honour killing' in revenge for eloping father

Ansbach police last night said “a man, according to our current knowledge the perpetrator, died” in the explosion just two miles from a US army garrison.

It remains unclear whether the bomber's plan was to kill himself or "take others with him into death", the Nordbayern website said.

Bavaria's Interior Minister Joachim Herrmann said the man has tried to commit suicide twice before.

No further arrests have been made in connection with the blast, but an investigation by German prosecutors in underway.

Herrmann told reporters: "It's terrible ... that someone who came into our country to seek shelter has now committed such a heinous act and injured a large number of people who are at home here, some seriously.

"It's a further, horrific attack that will increase the already growing security concerns of our citizens.

"We must do everything possible to prevent the spread of such violence in our country by people who came here to ask for asylum."

"Because the rucksack and this bomb were packed with so many metal parts that could have killed and injured many more people, it cannot simply be considered a pure suicide attempt."

A U.S. intelligence official, speaking on condition of anonymity, said investigators would focus on what the bomber was doing before he left Syria and why he was denied asylum.

U.S. sources said the bombing did not appear to be a well-planned operation and could well turn out to be the act of another deranged individual.

Michael Siefener, spokesman for the regional interior ministry, said: "The explosion was set off deliberately."

He added authorities were trying to establish the exact cause.

13 Emergency ... Armed police and fire teams were assembled in the aftermath

13 Taking no chances ... Police sealed off the area around the blast Credit: DPA

13 Flash response ... Emergency services are on high alert in wake of recent attacks Credit: Reuters

Bavarian security officials confirmed the unnamed 27-year-old had been denied asylum a year ago after living in Germany for a year.

He was given leave to temporarily stay given the situation in his home country and was handed an apartment in Ansbach.

A large scale operation was underway overnight, with an area around the bar cordoned off, armed police on the scene and a helicopter hovereing nearby.

It was initially thought the explosion was caused by a gas leak, however late last night Ansbach Mayor Carda Seidel confirmed it was an explosive device, and a spokesman for the Bavarian Interior Ministry said the explosion was "not an accident".

This attack will surely fan the flames of criticism being levelled at Angela Merkel over her "open door" immigration policy.

It is the latest in a string of tragedies to rock the European country, after an 18-year-old went on a shooting spree at a Munich shopping centre on Friday and a 17-year-old Afghan refugee injured four in an axe and knife attack on a train in Wurzburg last Monday.

The bomb attack also came just hours after a machete-wielding Syrian refugee hacked a pregnant woman to death in a "crime of passion" in Reutlingen.

13 On the scene ... Emergency crews rushed to the scene of the violent blast Credit: Reuters

13 Worried ... Crowds gathered in the the town as police began their operation

The pregnant woman in Reutlingen was murdered by the 21-year-old Syrian refugee, who she reportedly worked at a cafe with.

Two other people were injured in the attack before the unnamed man was arrested.

It was last night revealed Munich massacre nut Ali Sonboly, 18, plotted his revenge on classmates for a year and bought a Glock handgun online.

Ten former pupils turned up to his fake Facebook invite for free burgers at McDonald’s opposite the Olympia shopping mall.

But all escaped his rampage on Friday, in which nine died and 27 were injured.

13 Location ... Ansbach is near Nuremburg in Bavaria -- the same region that witnessed the Munich attack on Friday Credit: Google Maps

13 Investigation ... A large police presence was in force early on Monday morning Credit: DPA

13 The pack back used to carry an explosive device at the scene of the suicide attack Credit: DPA

13 Special Police secure a street following the suicide attack Credit: Reuters

13 A policeman examines the backpack left at the entrance to a building in Ansbach Credit: AP:Associated Press

13 Police are still investigating the scene following the suicide attack last night Credit: DPA

Police revealed Sonboly, who killed himself after the attack, bought the 9mm semi-automatic pistol on the dark web, which is used for illegal activities, for £80.

It was a theatre prop, re-bored to fire live rounds.

Last night cops arrested a potential accomplice said to know about Sonboly’s plot.

Sources said the 16-year-old Afghan was a pal and he is accused of trying to organise a similar gathering at another McDonald’s in the city.

Do you have a story for The Sun Online news team? Email us at tips@the-sun.co.uk or call 0207 782 4368.