A suspected bomber has killed himself and injured 15 other people in an explosion near a music festival in the southern German city of Ansbach.

Authorities have said it was a terrorist attack and that the bomber had pledged allegiance to the leader of the so-called Islamic State group.

More than 2,000 people were evacuated from the festival as a result of the blast, the fourth violent incident in Germany in recent days.

What happened?

The 27-year-old Syrian is believed to have detonated an explosive device at around 10pm local time on Sunday as he carried a backpack through a busy area.

The explosion happened outside a restaurant called Eugens Weinstube in Ansbach, a small city of around 40,000 people around 90 miles north of Munich and home to a US Army base.

Four of those injured were in a serious condition, officials said.

Bavarian interior minister Joachim Herrmann said the man had tried to go into the music festival but was denied entry.

The backpack contained metal items used in "wood manufacturing" and could have killed many more people, Mr Herrmann said.

Who was the attacker?

An image of the alleged Ansbach bomber. Credit: Amaq News Agency/SITE

The identity of the Syrian man has not yet been officially released, but he has been named in German media as Mohammed Deleel.

Officials said the 27-year-old Syrian the suspect had been living in Ansbach for some time.

His application for asylum had been denied but he was not in danger of being deported to his home country because of the ongoing conflict in Syria.

However, officials have revealed he was due to be deported to Bulgaria and had received two deportation notices, most recently on July 13.

He had been in treatment because of previous suicide attempts.

Who was behind the attack?

The man in the video allegedly released by IS. Credit: Amaq News Agency

So-called Islamic State claimed responsibility for the attack and released a statement on Monday.

They said, via the group's Amaq news agency: "He carried out the operation in response to calls to target countries of the coalition that fights Islamic State".

Mobile phone footage of the bomber found by police also threatened an attack in Arabic and pledged allegiance to the leader of IS.

Bomb making equipment was also found at Daleel's home.

Amaq later issued an image of the alleged attacker and a video.

In the two-minute clip a man with a face covered with a black scarf, who Amaq say is Daleel, threatens to make life intolerable and warns: "We will blow up your homes."

He also vow's that Germany's people "won't be able to sleep peacefully anymore".

German authorities have yet to confirm if it was the same video found on Daleel's phone.

ITV News Security Editor Rohit Kachroo tweeted:

What did witnesses see?

Bavarian interior minister Joachim Herrmann said the man lived in the city. Credit: Reuters

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

Emergency workers are seen following the explosion. Credit: Reuters

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

"But then people came past and said it was a rucksack that had exploded. Someone blew themselves up."

Another witness, Thomas Lewinsky, said that after an initial impulse to get away, he decided to go back to see if he could help, people came walking towards him saying that a backpack had exploded.

He said: "There was an extremely loud bang, more like a loud rattle, definitely the sound of an explosion.

"At first I was shaken, I didn't know what it was, went back, away from there, before I gathered myself and in the next moment and thought 'let's see what happened, maybe I can help in some way.'

"By the time I went back people were already coming towards me, all going into the opposite direction, wanting to get away from the city centre. Then fire fighters already started arriving and cordoned off the area."

How have authorities reacted?

Armed police at the scene of the raid on Monday morning. Credit: APTN

The German interior minister has ordered an increased police presence at airports, railway stations and borders after the recent attacks.

An armed police raid took place early on Monday in a suburb around two miles from the scene of the explosion.

Forensic teams could be seen carrying out a search at a building used to house asylum seekers.

Investigators have appealed for anyone with mobile phone footage of the blast to come forward.

The attacker's neighbour spoke to ITV News and expressed his disbelief that his former flatmate could be a member of the so-called Islamic State:

The latest deadly incident in Germany

The blast was the fourth violent incident in Germany in recent days.

Earlier on Sunday, a 21-year-old Syrian refugee was arrested after killing a pregnant woman in a machete attack that killed one woman in Reutlingen, near Stuttgart.

That attack came after a refugee from Pakistan wielding an axe injured five people near Wuerzbuerg, also in southern Germany, before he was shot dead by police on July 18.

On Friday, a massacre in Munich left nine people dead and 27 injured.

Forensic teams search a building used to house asylum seekers. Credit: RTV

The incident will fuel growing public unease over Chancellor Angela Merkel's open-door refugee policy, under which more than one million migrants have entered Germany over the past year.

Mr Herrmann said: "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."

In January a programme was launched in Ansbach to help refugees assimilate by teaching them the basics of law in their new host country. The initiative taught lessons on freedom of opinion, the separation of religion and state and the equality of men and women.