Police have found a hand-painted Islamic State flag in the room of a young Afghan refugee who attacked passengers on a train in southern Germany with an axe, a state minister said on Tuesday.

Bavarian Interior Minister Joachim Herrmann said however it was too early to say whether the youth was a member of Islamic State or any other militant group. Islamic State claimed responsibility for the attack, according to its Amaq news agency.

The 17-year-old severely wounded four Hong Kong residents, two of whom are now in critical condition, on the train late on Monday then injured a local woman after fleeing before police shot him dead.

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

Source: b'Source: Reuters'

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

At least one witness reported that the attacker, who had been living with a foster family in the nearby town of Ochsenfurt, had shouted "Allahu Akbar" (God is greatest).

Herrmann told Reuters TV that a hand-painted IS was found among his belongings when police searched his home.

"Some things clearly point to an Islamist background, but there is no evidence at this point connecting him to any other individuals, or indicating whether he radicalized himself," Herrmann said. "That must all still be investigated."

(Feature Image Source: Reuters)