At roughly 10:10pm on Sunday evening, a 27-year-old man wearing a rucksack approached a bar called 'Eugens Weinstube' in the centre of Ansbach and detonated an explosive device that had been studded with pieces of metal.
The attacker, who prosecutors have identified as Mohammed D., died in the blast while 15 people were wounded, three of them seriously.
The 27-year-old had tried to enter a nearby music festival but had been rejected because he didn't have a ticket.
The man came to Germany two years ago from Syria and made an application for asylum. But authorities rejected the application last year. Since then he has been living with the status of a 'tolerated refugee' (granted to those who do not receive asylum but are unable to return to their home countries) in housing in Ansbach.
Bavarian interior minister Joachim Herrmann said the man had been taken into psychological care after twice attempting to take his own life. He also already had a police record for drug possession among other things.
On Monday morning investigators searched the man's room in a refugee centre in the town and found mobile phones and several sim cards, as well as a roll of €50 notes.
On a mobile phone police found a video in which the bomber pledged his allegiance to Isis, Bavarian interior minister Joachim Herrmann said on Monday at a press conference.
In the video he announced he would “attack the Germans because they stand in the way of Islam.”
He also pledged allegiance specifically to Abu Bakr al-Baghdadi, the leader of the Islamic State.
According to Herrmann the video confirms that the 27-year-old's detonation of a bomb in the town's centre had an Islamist motive behind it.
Media are also reporting that the man should have been deported to Bulgaria where he first applied for asylum.
A spokesperson for the Interior Ministry told Spiegel: "At this point I cannot tell you why the deportation did not take place."