A young Afghan who attacked passengers on a train in Bavaria with an axe had entered Germany last summer with a wave of migrants, officials said, raising more questions about Chancellor Angela Merkel’s open-door refugee policy.

The 17-year-old, who a witness said shouted “Allahu Akbar” (God is Great) during the attack, severely wounded four Hong Kong residents on the train late on Monday, then injured a local woman after fleeing, before police shot him dead.

The case is likely to deepen worries about so-called “lone wolf” attacks in Europe and could put political pressure on Merkel, who has welcomed hundreds of thousands of migrants to Germany over the past year.

The attacker came to Germany as an unaccompanied minor and was registered as a refugee on June 30 last year in Passau, officials said. Germany welcomed about one million migrants in 2015, many fleeing war in Afghanistan, Syria and Iraq.

“In the minds of many people, his arrival is directly linked to Merkel and her liberal refugee policies,” said Frank Decker, political scientist at Bonn University.

The attack took place days after a Tunisian delivery man ploughed a truck into crowds of Bastille Day revelers in the southern French city of Nice, killing 84. Islamic State has also claimed responsibility for that incident.

Public support for Merkel has risen since Britain voted on June 23 to leave the EU, helping reverse a fall in her popularity caused by the refugee crisis. Decker said a Nice-style attack here could quickly end those gains.

“It would boost those who have called Merkel’s policies a mistake,” he said. “Merkel would be blamed.”

Unlike neighbours France and Belgium, Germany has not been the victim of a major attack by Islamic militants in recent years, although security officials say they have thwarted a large number of plots.

In the minds of many people, the attacker’s arrival is directly linked to Merkel and her liberal refugee policies

A leader of the anti-immigrant Alternative for Germany (AfD) said Merkel and her supporters were to blame for the dangerous security situation because their “welcoming policies had brought too many young, uneducated and radical Muslim men to Germany”.

Imam Arbab Ahmad, whose mosque in Wuerzburg lies about 12 kilometres from the scene of the attack, said he feared a backlash against Muslims after the attack.

“I am anxious,” he said. “It was a totally inhumane attack on innocent people. Every human being should condemn it, not just Muslims.”

Migrants attending a lesson at the Institute for Intercultural Communication in Berlin, Germany. Photos: Hannibal Hanschke/PA WireMigrants attending a lesson at the Institute for Intercultural Communication in Berlin, Germany. Photos: Hannibal Hanschke/PA Wire

Police found a hand-painted Islamic State flag in the refugee’s room at his foster family’s home, along with a letter he appeared to have written to his father, which officials said read: “And now pray for me that I can get revenge on these non-believers, pray for me that I go to heaven.”

IS posted a video in which a man whom it identifies as the Afghan refugee vows to carry out a suicide mission and urges other Muslims to do the same.

In the two minute and 20 second video, entitled Germany – Video of the Islamic State Soldier Muhammad Riyad Who Carried Out the Wuerzburg Attack, a young man wields a small knife, which he says he will use to slaughter infidels and avenge the deaths of men, women and children in Muslim countries.

“I will carry out a suicide operation in Germany,” the young man says in the video. “I will slaughter you in your houses.”

German officials were checking if the man in the video was in fact the attacker. Merkel’s chief of staff, Peter Altmaier, told ZDF television: “The security authorities expect that this video is in all likelihood authentic, and also the letter.”

Authorities have not released the attacker’s name publicly, because he was a minor. They have said he was not on any of the intelligence services’ watch lists.

IS claimed responsibility for the attack, according to its Amaq news agency. But Erik Ohlenschlager, public prosecutor in Bamberg, said there was no evidence the attacker had been in contact with IS, though he said the IS flag the young man appeared to have painted suggested he had developed a sympathy for the group.

German Family Minister Manuela Schwesig playing with children during a visit at a refugee shelter in Berlin, Germany.German Family Minister Manuela Schwesig playing with children during a visit at a refugee shelter in Berlin, Germany.

Bavarian Interior Minister Joachim Herrmann said people who knew the attacker had described him as a “quiet and balanced person who went to the mosque for important holidays, but wasn’t necessarily there every week.

“He was described as a devout Muslim, but not in any way one who was a radical or fanatic,” Herrmann added.

The young man started attacking his passengers with an axe and a knife around 9pm local time as the train was approaching its last stop, the Bavarian city of Wuerzburg, Herrmann said.

Ohlenschlager said the attacker, who had learned on Saturday that a friend of his had died in Afghanistan, struck his victims with full force in the body and head, adding: “The injuries are very bad.”

After a passenger pulled the train’s emergency brake, the attacker fled and struck in the face a woman who was walking her dog. He was pursued by a police unit who shot him dead.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.