ISIL says an Afghan teenager who carried out an axe attack on a German train, severely wounding four people, was one of its fighters.
A hand-made flag of the so-called Islamic State was found among the belongings of the 17-year-old asylum seeker who was shot dead by police as he fled following the attack.
He is said to have cried ‘Allahu Akbar’ as he lashed out at passengers with an axe and a knife on a regional rail service near Wurzburg in Bavaria on Monday night.
Those hurt were a family group from Hong Kong. At least two of the victims are in a critical condition.
Officials say the Afghan youth, who had arrived in Germany as an unaccompanied minor, was staying with a foster family nearby.
The statement from ISIL, released through its online Amaq news agency, said the attacker had responded to calls to target countries in the coalition fighting Islamic State.
Germany welcomed roughly one million migrants last year, including thousands of unaccompanied minors.
Unlike France and Belgium, It has avoided a major attack by Islamist militants in recent years, although security officials say they have thwarted a large number of plots.