Police found a hand-painted Islamic State flag and a text written partly in Pashto in the room of a young Afghan refugee who attacked passengers on a train in southern Germany with an axe, a state minister said on Tuesday.
At least four of those injured on the train were from Hong Kong, Hong Kong's chief executive, CY Leung, said in a statement.
The Amaq News Agency, which often transmits messages from ISIS, said in an announcement that the attack was carried out by an "Islamic State soldier".
The 17-year-old attacked at least four passengers with an ax and knife on a train near Wuerzburg-Heidingsfeld on Monday night, but was shot and killed by a special police unit that happened to be nearby.
The group's spokesman had called for its sympathizers to carry out attacks against Western nations, involved in the U.S.-led coalition battling the group in Syria and Iraq, before the Islamic holy month of Ramadan.
A senior Germany security official said earlier Tuesday that a hand-painted flag of the IS group was found in the attacker's room.
After the train made an emergency stop, the suspect fled and a few hundred meters (yards) away encountered two women walking a dog.
German media, citing a spokesman for the Bavarian interior ministry, reported that the man had shouted "Allahu Akbar" (God is great) during the attack, but neither Herrmann nor Hench said they could confirm that.
Islamic State flag found in Afghan train attacker's home
The attacker initially lived in a shelter for unaccompanied refugee minors in Ochsenfurt but was transferred to a foster family two weeks ago. However, other passengers on the train, he said, didn't recognize "any particular Islamist motive" to the attack.
Two of those injured in the attacks were in a critical condition and several of the injured included members of a Chinese family, he added, without giving any further details.
An eyewitness, who lives next to the railway station, told DPA news agency that the train, which had been carrying around 25 people, looked "like a slaughterhouse" with blood covering the floor. "He suddenly attacked passengers with a knife and an ax, critically injuring several".
The attack took place days after a Tunisian delivery man ploughed a truck into crowds of Bastille Day revelers in the southern French city of Nice, killing 84.
The 62-year-old father, his 58-year-old wife, their daughter, 26, and her boyfriend, 30, were seriously injured, while the couple's 17-year-old son escaped unscathed.
The mayor of Wuerzburg condemned the attack. Investigators were talking to the foster family, witnesses and the attacker's friends.
On Tuesday morning, officers could be seen removing the attacker's body from the scene. The father and the boyfriend had tried to defend the other family members, dpa said. According to the statistics of a year ago alone, Germany had registered more than 1 million refugees, out of whom more than 150,000 were Afghans, seeking to enter the country. He was later sent to a psychiatric hospital.