A young German man has been arrested after one person was killed and three others injured in a knife attack at a railway station near Munich, authorities said.

Police quoted witnesses as saying the assailant made "politically motivated comments" during the stabbings. Some reports said he shouted "Allahu Akbar" - "God is great".

The 27-year-old suspect, a German who was not resident in Bavaria, attacked several people with a 10cm knife at Grafing Bahnhof, police said.

The incident happened shortly before 5am local time (0300 GMT) at the station, which is about 30km east of Munich and near the end of one of the city's commuter railway lines.

At the scene, police forensic experts in white overalls marked more than 40 bloody footprints - some of them barefoot - on the platform with chalk numbers and collected evidence, including a mobile phone that was pulled from the gap between the train and platform.

"We can say very little at the moment about the background" to the attack, said Karl-Heinz Segerer, a spokesman for Bavaria's state criminal police office.

"Witness questioning shows that there were politically motivated comments on the perpetrator's part" during the attack, he told n-tv television.

He did not give details and said witnesses and the suspect will be pressed on what he said and to whom.

Bavaria's top security official, Interior Minister Joachim Herrmann, said officials will also look into whether the attacker was mentally disturbed.

Police and prosecutors said a 50-year-old man died from his injuries. The other victims were men aged 43, 55 and 58. They have not yet been identified.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.