A teenage Afghan refugee armed with an axe and knife injured four people on a train in southern Germany before being shot dead by police, officials say.
Three people in a group from Hong Kong were seriously hurt and one slightly injured in the attack in Wuerzburg. Another 14 were treated for shock.
Bavarian Interior Minister Joachim Herrmann said the attacker was killed as he tried to flee the scene.
The motive for the attack is not yet clear.
The South China Morning Post said it was believed the four injured were a 62-year-old man, his 58-year-old wife, their daughter, 27, and her boyfriend, 31. The 17-year-old son travelling with them was not hurt, it said.
A source told the paper the father and boyfriend had tried to protect the other members of the group.
Mr Herrmann said the attacker was a 17-year-old Afghan refugee who had been living in the nearby town of Ochsenfurt.
He told public broadcaster ARD that the teenager appeared to have travelled to Germany as an unaccompanied minor.
Mr Herrmann said authorities were looking into reports that the attacker had yelled out "an exclamation". Some witnesses quoted by German media said they had heard him shout "Allahu akbar" ("God is great") during the attack.
The incident happened at about 21:15 (19:15 GMT) on the train which runs between Treuchlingen and Wuerzburg.
"Shortly after arriving at Wuerzburg, a man attacked passengers with an axe and a knife," a police spokesman said.
Police said the attacker had fled the train but was chased by officers who shot him dead.
One local man told DPA news agency that the train carriage where the attack took place "looked like a slaughterhouse".
He said he saw people crawl from the carriage and ask for a first-aid kit while other victims lay on the floor inside.
Hong Kong Chief Executive Leung Chun-ying has condemned the attack. Immigration officials from the city will accompany family members to Germany.
Although the motive has not been established, the BBC's Damien McGuinness in Berlin says there is nervousness in Germany about attacks by Islamist extremists following the attacks across the border in France.
In May, a man reportedly shouting "Allahu akbar" killed a man and wounded three others in a knife attack at a railway station near the German city of Munich.
He was later sent to a psychiatric hospital and authorities said they had found no links to Islamic extremism.
Were you on the train? Have you been affected by the incident? Tell us your experiences by emailing firstname.lastname@example.org.
You can also contact us in the following ways: