Published on 10:41 AM, July 19, 2016

German train attack: Afghan refugee 'had IS flag in room'

German emergency services workers work in the area where a man with an axe attacked passengers on a train near the city of Wurzburg, Germany early July 19, 2016. REUTERS/Kai Pfaffenbach.

A hand-painted flag of so-called Islamic State has been found in the room of an Afghan refugee accused of carrying out an axe and knife attack on a southern German train, officials say.

The 17-year-old man injured four people from Hong Kong, three seriously, in the attack in Wurzburg on Monday evening. He was shot dead by police as he fled.

He had reportedly shouted Allahu akbar" ("God is great").

The attack comes days after a deadly IS-claimed attack in Nice in France.

Joachim Herrmann, the interior minister of the state of Bavaria, told German TV the flag had been found among the teenager's belongings in his room in the nearby town of Ochsenfurt.

The teenager, who had claimed asylum after travelling to Germany as an unaccompanied minor, had been living with a foster family after moving from a refugee centre in the town.

Last year Germany registered more than one million migrants, including more than 150,000 Afghans, although the number has slowed dramatically this year since new EU measures were taken to stop the flow.

The South China Morning Post said it was believed the four people injured were a 62-year-old man, his 58-year-old wife, their daughter, 27, and her boyfriend, 31. The 17-year-old son travelling with them was not hurt, it said.

A source told the paper the father and boyfriend had tried to protect the other members of the group.

The attack happened at about 21:15 (19:15 GMT) on the train which runs between Treuchlingen and Wurzburg.

Police said the attacker had fled the train but was chased by officers who shot him dead.

One local man told DPA news agency that the train carriage where the attack took place "looked like a slaughterhouse".