A German man stabbed to death one person and slashed three more Tuesday in what authorities said may have been an Islamist attack, without ruling out that the assailant suffered mental problems.
Police said they had arrested a 27-year-old German national who knifed four people around 5:00am (0300 GMT) at the commuter railway station of the small town of Grafing, east of Munich.
One of the victims, a 50-year-old man, later died of his wounds in hospital. The others injured were men aged 43, 55 and 58. One of the victims was seriously hurt, the other two more lightly wounded.
The "assailant made remarks at the scene of the crime that indicate a political motive -- apparently an Islamist motive," said Ken Heidenreich, spokesman for the prosecutor's office. "We are still determining what the exact remarks were."
Local media reported witnesses as saying the man had yelled "Allahu akbar" (God is greatest) and "you unbelievers" during the attack.
If an Islamist militant motive is confirmed, it would be the country's third Islamist-linked knife attack since September, but police were also investigating whether the assailant had previous psychological or drug problems.
Bavaria state's interior minister Joachim Hermann said the attacker, named locally as Paul H., was a German national, as authorities said he hailed from central Hesse state and did not have a migrant background.
"As to what extent there were other background factors, or whether this is more about questions of mental instability or drug addiction, still needs to be investigated," Hermann said on BR24 television.
In the dawn attack, the assailant stabbed one man aboard a train, another on the platform, then left the station and slashed two more men on bicycles outside, said Bavarian police spokesman Karl-Heinz Segerer on NTV news channel.
"In the meantime local police received an emergency call, and the officers quickly arrived at the scene and were able to detain the man," said Segerer.
Bloody footsteps and police forensic officers in white plastic suits could be seen at the cordoned-off railway station in video footage from Grafing, 30 kilometres (20 miles) east of the Bavarian capital.
"There is no longer any threat to the population," said another police spokeswoman, Michaela Gross.
Town mayor Angelika Obermayr expressed shock at the bloody crime in the sleepy town of 13,000 people.
"We are an absolutely peaceful Bavarian small town in the greater Munich region," she said on NTV. "Something like this is absolutely new and has deeply shocked the people here who only know things like that from television.
"That something like that happened here is absolutely unbelievable."
Last August, two Islamist militants claiming to belong to the Islamic State (IS) group threatened Germany with attacks in an online execution video.
In the rare German-language video they urged their "brothers and sisters" in Germany and Austria to commit attacks against "unbelievers" at home.
Since then Germany had seen at least two bloody knife assaults blamed on Islamists, before Tuesday's attack.
In February a 15-year-old girl identified as Safia S. stabbed a policeman in the neck with a kitchen knife in what prosecutors later said was an IS-inspired attack.
She attacked the officer during a routine check at Hanover train station in the country's north before being overpowered by another police officer.
Federal prosecutors later said the teenager had "embraced the radical Islamist militant ideology of the foreign terrorist group Islamic State of Iraq and Syria" and was in contact with an IS fighter in Syria.
Last September, a 41-year-old Iraqi man identified as Rafik Y. stabbed and seriously wounded a policewoman in Berlin before another officer shot him dead.
The man had previously spent time in jail for membership of a banned Islamist group and had been convicted in 2008 of planning an attack in Berlin against former Iraqi prime minister Iyad Allawi.
According to the German domestic intelligence agency, some 740 people have left Germany to join Islamist militant groups in Syria or Iraq. About 120 of them have been killed, while about one third have returned to Germany.