Berlin (AFP) – A Syrian migrant set off an explosive device near an open-air music festival in southern Germany that killed himself and wounded a dozen others, authorities said Monday, the third attack to hit the region in a week.

The 27-year-old had spent time in a psychiatric facility, but the authorities have not ruled out an Islamist motive for the attack on Sunday night in the city of Ansbach.

Germany is reeling after nine people died in a shopping centre shooting rampage in Munich on Friday and four people were wounded in an axe attack on a train in Wuerzburg on July 18.

All three attacks were in Bavaria, which has been a gateway for thousands of Syrian refugees under German Chancellor Angela Merkel’s open door policy.

Police said the man intended to target the music festival on Sunday but was turned away because he did not have a ticket, and set off the explosive device outside a nearby cafe.

The perpetrator was killed in the blast, police said in a statement, and a spokeswoman said 12 people were wounded, three of them seriously.

“Unfortunately, this is a terrible new attack which will surely increase people’s anxiety,” regional interior minister Joachim Herrmann said.

Herrmann said he was worried “the right to asylum would be undermined” by the events of the past week.

Sunday’s explosion happened just outside a cafe in Ansbach city centre, not far from where more than 2,500 people had gathered for the concert, at around 10 pm (2000 GMT).

– Attacker known to police –

Police blocked off the area and emergency services were at the scene. Bomb experts were also sent to determine the cause of the blast.

Ansbach deputy police chief Roman Fertinger said there were “indications” pieces of metal had been added to the explosive device.

Herrmann said the attacker, who came to Germany two years ago but had his asylum claim rejected after a year, had tried to kill himself twice in the past and had spent time in a psychiatric clinic.

He said investigators “have not ruled out” he had an Islamist motive.

The assailant, who lived in Ansbach, was already known to police, in particular for an offence linked to drugs, Herrmann also told news agency DPA.

Europe has been on edge for months after a string of deadly attacks claimed by the Islamic State jihadist group, including bombings in Brussels and carnage at Bastille Day celebrations in the southern French city of Nice.

– Obsessed with mass murder –

Police on Sunday released more details of Munich mall attacker David Ali Sonboly, saying the 18-year-old was depressed and had spent two months in a psychiatric unit last year.

The teen who had German and Iranian nationality, was obsessed with mass killings and spent a year preparing for the shooting spree, police said.

At least 35 people were also wounded during Sonboly’s attack, which began at a McDonald’s outlet and ended with him turning his 9mm Glock pistol on himself.

Investigators have ruled out any link with IS jihadists, although he appears to have planned the assault with chilling precision for a year.

Police have also arrested a 16-year-old Afghan friend in connection with the shooting.

Hundreds of people, many of them in tears, gathered on Sunday outside the Munich shopping centre where the attack took place to pay tribute to the victims.

Already steeped in grief and shock, Germans were further rattled by news that a Syrian refugee had killed a 45-year-old Polish woman with a machete in the southwestern city of Reutlingen.

Police said that incident on Sunday, in which three others were injured, did not bear the hallmarks of a “terrorist attack”.

“When a man and woman have an argument, we assume that we are dealing with a crime of passion,” a local police spokeswoman told DPA.

Three people were also injured in the attack, which ended when the 21-year-old assailant was hit by a car.

NTV showed amateur video footage of the suspect running away from the scene before cutting to him lying on the ground, his face bloodied and his hands cuffed by police.