"The perpetrator of the stabbing attack in Germany was one of the fighters of the ISIL and carried out the operation in answer to the calls to target the countries of the coalition fighting the ISIL," the statement, published in Amaq news website said, The Local reported.
Earlier on Tuesday, the interior minister for the Germen state of Bavaria said a hand-drawn ISIS flag was found in the room of the 17-year-old Afghan refugee who attacked passengers on a train in southern Germany before being shot dead by police.
Speaking on German public television, Interior Minister Joachim Herrmann said it was too early to speculate about the motives of the attacker, who had wielded an axe and a knife, and whether he was a member of a terror group or had become self-radicalized in recent times.
Herrmann said two of those injured in the attacks were in a critical condition. Several of the injured included members of a Chinese family, he said, without giving any further details.
Four people were severely wounded in the attack before he was shot dead by police, the interior minister for the state of Bavaria said.
The attack comes just days after a Tunisian delivery man drove a 19-tonne truck into crowds of Bastille Day revelers in the southern French city of Nice, killing 84.
Unlike neighbors France and Belgium, Germany has not been the victim of a major attack by militants in recent years, although security officials say they have thwarted a large number of plots.
Germany welcomed roughly 1 million migrants in 2015, including thousands of unaccompanied minors. Many were fleeing war in countries like Syria, Iraq and Afghanistan, FNA reported.
219