An axe-wielding 17-year-old has gone on a rampage on board a train in Germany, leaving more than 20 people injured — three of them seriously. Fourteen others are reportedly in shock following the incident.

South China Morning Post reported that a family of four Hong Kong nationals were injured on board the train. The Hong Kong Immigration Department said the four were part of a group of five travelling on the train. The four injured are believed to be the father, 62, the mother, 58, their 27-year-old daughter and the daughter's 31-year-old boyfriend.

Germany train
Police officers stand by a regional train in Wuerzburg southern Germany after a man attacked train passengers with an axeKarl-Josef Hildenbrand/ AFP

It is believed that the father and the boyfriend sustained "relatively serious" injuries when they tried to protect other family members in their group from the attacker. The fifth member of the group, their 17-year-old son was not harmed, the newspaper said.

The suspect was killed as he tried to flee from the train. Bavarian Interior Minister Joachim Herrmann has told the state television that the attacker was a 17-year-old Afghan man who came to Germany as an unaccompanied minor refugee.

Herrmann told the public broadcaster ARD that the teenager had been living in the nearby town of Ochsenfurt for a few months with a foster family. It is believed that he had lived in a refugee camp before that. The motive for the attack is as yet unclear.

The minister said that there was a report by one of the witnesses in the train that the teenager had shouted "Allahu Akbar" during the assault. This is being investigated, he said. For the moment, the attacker is being treated as a lone individual.

The incident occurred on the line between Wurzburg-Heidingsfeld and Ochsenfurt and it has since been closed. The incident happened at about 9.15pm local time. "Shortly after arriving at Wuerzburg, a man attacked passengers with an axe and a knife, a police spokesman said.

He said the teenager fled the train on foot but was chased by officers who shot him dead. A police taskforce happened to be in the vicinity when the incident took place. The 17-year-old is reported to have been carrying an axe and a knife when he attacked members of the taskforce.

A number of ambulances are at the scene. Police spokesman Fabien Hench told Sky News some victims are in a serious condition. Hench confirmed the suspect had been shot dead.

1.2 million refugees living in Germany

According to estimates, around 1.2 million refugees are believed to be living in Germany. A study published in April by the Friedrich Ebert Foundation thinktank said that around 154,000 Afghan nationals migrated to Germany in 2015. Of the total, only 32,000 applied for asylum. The study noted that more than 120,000 Afghans remain in Germany illegally or have moved on to other countries.

Afghans were the second largest group entering the EU. In 2015, a total of 178,230 Afghan nation sought asylum in the bloc last year. According to the study, the majority of Afghan migrants were young and male who had fled their home country due to the economic situation.

1 of 4