A 17-year-old Afghan asylum-seeker who went on a rampage on a Bavarian train with an ax and a knife appears to have acted alone, goaded on by online Islamic extremist propaganda, Germany's top security official said Wednesday.

Five people were wounded in the attack, including four members of a Hong Kong family, and two of the wounded remain in critical condition.

"It is not yet clear if they will all survive," Interior Minister Thomas de Maiziere told reporters in Berlin.

The Islamic State group has claimed responsibility for the attack and although German authorities say they have found no direct link to the extremists, an IS flag was found among the attacker's possessions and he refers to himself as a "soldier of the Islamic State" in a video posted by the group.  The suspect's name has not been released by authorities.

De Maiziere said it was not yet clear when the video was made, but confirmed that investigators had determined it was authentic, even if it probably was not produced by IS. It shows the young man waving a knife as he talks into the camera.

"It appears to be a classic farewell video of a suicide attacker," de Maiziere said.

Still, he said it was 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," de Maiziere said.

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

"If you can't come to Iraq and Syria, the least you can do is kill these infidels in the countries that you live in," he says.

In the video, the suspect speaks in Pashto, one of Afghanistan's main languages. He has 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.

De Maiziere said authorities were looking into the possibility that he might have been from Pakistan, but other evidence suggest his being 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, de Maiziere said.

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

Germany has not experienced the large, deadly attacks that France and Belgium have, although a string of sexual assaults and robberies on New Year's Eve in Cologne that prosecutors say were committed largely by foreigners gave rise to fears of whether the country could cope with the 1 million migrants it registered in 2015.

De Maiziere said when authorities have investigated information received about refugees with alleged connections to terrorism, it's 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.