Two people were killed and several others injured in a knife attack on Wednesday on a regional train travelling between Kiel and Hamburg in northern Germany, authorities said.
The interior ministry of the state of Schleswig-Holstein, on the Danish border, said the suspect was arrested at a train stop in the village of Brokstedt.
Earlier, the Bild newspaper had said five people were injured in the attack. The number of wounded couldn't immediately be confirmed.
Police were investigating at the train station in Brokstedt, the German railway Deutsche Bahn said on Twitter, adding some services between the two cities had been cancelled.
"Federal and state police are working closely together on investigating this case," state interior minister Sabine Suettelin-Waack said in a statement.