Isis's media wing has released a video allegedly showing the man responsible for an axe attack on a train in Germany pledging allegiance to the jihadist group.

German police have not confirmed the name of the 17-year-old Afghan attacker, who left two people in critical condition after the axe and knife attack on Monday night (18 July) in a train near the Bavarian city of Wuerzberg. The attacker was killed by police as he tried to flee.

The man in the video is identified as Muhammad Riyad, and is described as "a soldier of the Islamic State who carried out the Wurzburg attack".

In the video he brandishes a knife and speaks in Pashto, an Afghan dialect, with subtitles in Arabic.

Bavarian interior minister Joachim Herrmann said that no concrete links had been established between the teenager who carried out the attack and Isis.

However he said investigators had discovered a homemade Isis flag in the teenager's bedroom, partly in Arabic script and partly in Latin, suggesting that "he could have radicalised himself."

He said the attacker had arrived in Germany as a refugee, and had been staying with a foster family in the area.

Isis-affiliated news agency Amaq earlier released a report, claiming that the attacker "executed the operation in response to calls to target nations in the coalition fighting the Islamic state".

The attack is the first in Germany claimed by Islamic State.