Afghan train attacker kept IS flag in his German home

In this image taken from video police officer look on as the body of a 17-years-old attacker is carried to a hearse in Wuerzburg, southern Germany, Tuesday morning, July 19, 2016. The asylum seeker who shouted "Allahu akbar" ("God is great") during an ax and knife attack on a train, injuring at least five people, had a hand-painted flag of the Islamic State group in his room, a senior German security official said Tuesday. (News5 via AP) GERMANY OUT (The Associated Press)

Police officers stand at the crime scene near the river Main, background, where a 17-year-old man from Afghanistan was shot the night before, in Wuerzburg, Germany, Tuesday, July 19, 2016. On Monday evening, the man wielding an axe and knife attacked travelers on a regional train near Wuerzburg. Four people were seriously injured. He was shot and killed by police as he fled. (AP Photo/Michael Probst) (The Associated Press)

A German top official says a 17-year-old Afghan asylum seeker shouted "Allahu akbar" ("God is great") during an ax and knife attack on a train in southern Germany that injured five people.

Bavaria's interior minister Joachim Herrmann said Tuesday on public television that investigators raiding his room also found a hand-painted flag of the Islamic State group.

Herrmann told ZDF Television the attacker came to Germany two years ago as an unaccompanied minor, and applied for asylum in March. He lived in a home for teenage refugees until two weeks ago when he was placed with a foster family. He was shot and killed by police as he fled from the scene.

Herrmann said two victims — members of a Chinese tourist family — are in critical condition.