Story highlights ISIS flag found in assailant's apartment

Attacker was a 17-year-old Afghan man living in Germany, official says

Police shot and killed attacker; four passengers are in serious condition

Berlin (CNN) An ax-wielding man who attacked several people on a train in southern Germany late Monday evening has been shot dead by police, regional police spokesman Lt. Fabian Hench said.

The assailant, armed with a knife and an ax, was identified as a 17-year-old Afghan man living in Ochsenfurt, Bavaria, Bavarian Interior Minister Joachim Herrmann said.

After the initial incident, the train's emergency brakes were deployed and the attacker fled into a nearby town, Herrmann said at a news conference Tuesday.

Police chased the attacker and then met him very close to the river where they confronted him, Herrmann said.

The teen was aggressive and tried to attack cops with his ax before they opened fire and killed him.

Read More