Islamic State has posted a video of a man it says is the young Afghan who attacked passengers on a train in Bavaria with an axe.
In the two minute and 20 second video, entitled 'Germany - Video of the Islamic State Soldier Muhammad Riyad Who Carried out the Wuerzburg Attack', a young man wields a small knife, which he says he will use to slaughter infidels and avenge the deaths of men, women and children in Muslim countries.
"I am a soldier of the caliphate and I am going to carry out an suicide attack in Germany," the man rages in Pashto.
"Now the Islamic Caliphate has been established in Iraq, Al-Sham, Khorosan, Libya and Yemen and God Willing, soldiers of the caliphate will get you.
"They will slaughter you in your own back yard and they will live in your houses and break your rules and take your land."
German officials were checking if the man in the video was in fact the train attacker.
They have not released his name publicly, because he was a minor.
Officials have, however, stated the attacker was an Afghan refugee who had entered Germany last year with a wave of migrants, officials say.
The 17-year-old, who a witness said shouted "Allahu Akbar" (God is Great) during the attack, severely wounded four Hong Kong residents on the train late on Monday (local time), then injured a local woman after fleeing, before police shot him dead.
The case is likely to deepen worries about "lone wolf" attacks in Europe and could put political pressure on German Chancellor Angela Merkel.
The attacker was registered as a refugee on June 30 last year, officials said.
Germany welcomed about one million migrants in 2015, many fleeing war in Afghanistan, Syria and Iraq.
The attack took place days after a Tunisian delivery man ploughed a truck into crowds of Bastille Day revellers in the southern French city of Nice, killing 84.
Unlike neighbours France and Belgium, Germany has not been the victim of a major attack by Islamic militants in recent years, although security officials say they have thwarted a large number of plots.
A leader of the anti-immigrant Alternative for Germany (AfD) said Merkel and her supporters were to blame for the dangerous security situation because their "welcoming policies had brought too many young, uneducated and radical Muslim men to Germany".
Police found a hand-painted Islamic State flag in the refugee's room at his foster family's home, along with a letter he appeared to have written to his father, which officials said read: "And now pray for me that I can get revenge on these non-believers, pray for me that I go to heaven."
They have said he was not on any of the intelligence services watch lists.
Islamic State claimed responsibility for the attack, according to its Amaq news agency.
But Erik Ohlenschlager, public prosecutor in Bamberg, said there was no evidence the attacker had been in contact with Islamic State, though he said the IS flag the young man appeared to have painted suggested he had developed a sympathy for the group.
Two victims were in a critical condition.