A 17-year-old Afghan asylum seeker who launched an axe and knife attack on passengers on a train in Germany is believed to have acted alone.

Interior Minister Thomas de Maiziere said it appears the teenager, who was shot and killed by police after injuring five people in the attack on Monday night, was radicalised by watching online propaganda.

Mr De Maiziere said a video of the suspect that was posted by the Islamic State group is authentic, and seems to be a "classic farewell video of a suicide attacker".

He added that it is not clear when the video was made.

Islamic State has claimed responsibility for the attack in Wuerzburg, southern Germany.

Two of those injured in the attack remain in a critical condition, and Mr De Maiziere said: "It is not yet clear if they will all survive."

He added that it remains difficult to say whether to consider the train attack an act of terrorism or an attack by a disturbed individual.

"It might be an incident on the thin line between killing spree and terror," Mr De Maiziere said.

In the video, the suspect urged others to commit attacks.

He spoke in Pashto, one of Afghanistan's main languages. He had an eastern accent similar to that of Pakistanis who speak Pashto, leading to speculation that he may have lied about his homeland when he came to Germany last year as an unaccompanied minor asylum seeker to increase his chances of being allowed to stay.

Mr De Maiziere said authorities are looking into the possibility that he might have been from Pakistan, but other evidence suggests he was from Afghanistan, including comments he made about a friend in Afghanistan having recently been killed - something authorities think may have prompted him to plan his attack.

German authorities also have statements about family from Afghanistan on immigration documents, Mr De Maiziere said.

"There needs to be further investigation," he added.

A string of sexual assaults and robberies on New Year's Eve in Cologne that prosecutors said were committed largely by foreigners gave rise to fears about whether the country could cope with the one million migrants it registered in 2015.

Mr De Maiziere said when authorities have investigated information received about refugees with alleged connections to terrorism, it has almost always proved false, but there are still tips being looked into.

"One can't say there is no connection between refugees and terrorism," he said, but added that even without any refugees, the danger of a terrorist attack would still be considered high.