A hand-painted flag of so-called Islamic State has been found in the room of an Afghan refugee accused of carrying out an axe and knife attack on a southern German train, officials say.
The 17-year-old injured four people from Hong Kong, two critically, in the attack in Wuerzburg on Monday evening. He was shot dead by police as he fled.
He had shouted Allahu akbar” (“God is great”), a witness said.
The IS-linked Amaq news agency said the teenager was an IS “fighter”.
It said he had “carried out the operation 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.