The so-called Islamic State has released a video purporting to show an Afghan asylum seeker making threats before attacking a German train.
The 17-year-old injured four people with an axe and knife, one critically, in the attack in Wuerzburg on Monday evening. He was shot dead by police.
In the video, a young man brandishing a knife says he is an “IS soldier” preparing for a suicide mission.
BBC reported that German officials said they later found a hand-painted IS flag in his room.
The teenager reportedly shouted the Islamic phrase “Allahu akbar” (“God is great”) during the attack.
The self-styled news agency of IS said he had launched the attack “in answer to the calls to target the countries of the coalition fighting the Islamic State”.
The attack comes days after a lorry ploughed into a crowd in Nice in France, killing 84 people. The self-styled Islamic State group said one of its followers had carried out that attack.
In the video, IS identified the attacker as Muhammad Riyad, who can be heard speaking Pashto.
Joachim Herrmann, the interior minister of the state of Bavaria, said the flag had been found among the teenager’s belongings in his room in his foster home in the nearby town of Ochsenfurt.
A text written in Pashtun was also found, he said, and it showed a strong indication that the teenager “could be a person who had been self-radicalised”.
Mr Herrmann said those who had interacted with the young man in recent months described him as calm and quiet and they could not understand his actions.
The teenager had gone to the mosque “on special occasions”, he said, but no-one had noticed any radical behaviour and there were no signs yet of a direct link to jihadist networks.
Mr Herrmann said there was no indication Chinese citizens had been specifically targeted.
He also defended the police who shot the attacker, saying the teenager had run at officers brandishing the axe.
The Afghan teenager, who had claimed asylum after travelling to Germany a year ago as an unaccompanied minor, had been living with the foster family since moving from a refugee centre in the town two weeks ago.
Last year Germany registered more than one million migrants, including more than 150,000 Afghans, although the number has slowed dramatically this year since new European Union measures were taken to stop the flow.
PHOTO: train attacker