A knife-wielding man described as a stateless Palestinian has fatally stabbed two passengers and injured seven others on a train in northern Germany before being grabbed by members of the public and arrested by police, officials say.
The motive of the attack was not immediately known.
German police said the suspect used a knife to attack several passengers shortly before a regional train travelling from Kiel to Hamburg arrived at the Brokstedt station.
Police spokesman Juergen Henningsen from the nearby city of Flensburg said two of the stabbed people died after the attack.
Three were severely injured and four others suffered minor injuries.
No details were given about the identity of the victims.
The attacker was also injured and taken to the hospital, police said.
German Interior Minister Nancy Faeser expressed shock about the brutal attack.
"The knife attack in a regional train is shocking news. All our thoughts are with the victims of this terrible act and their families," she said.
"The background to the crime is now being investigated at full speed," Faeser added.
"I would like to sincerely thank the police and rescue workers who responded."
Authorities said they were first alerted to the incident shortly before 3pm when several passengers on the train made emergency calls to police.
Police said the train was stopped and the attacker was detained outside the train after several witnesses held him until officers arrived to detain him.
The interior minister of Schleswig-Holstein state, Sabine Suetterlin-Waack, condemned the attack.
"It is terrible," she told German public broadcaster NDR.
"We are shocked and horrified that something like this has happened."
She later told the DPA news agency the attacker was a stateless 33-year-old Palestinian man.
Regional police and the federal police were on the scene and the prosecutor's office was investigating the attack, NDR reported.
The train station in Brokstedt was closed for several hours and train traffic was delayed across northern Germany.
Train operator Deutsche Bahn expressed its condolences on Wednesday evening saying that "our deepest sympathy goes to the relatives of the victims. We wish those injured a speedy and complete recovery."