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

The 17-year-old, who shouted "Allahu akbar" ("God is great") during the attack late on Monday, severely wounded four Hong Kong residents, then fled the train and injured a German woman 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.