Update 10am: 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 4in (10cm) knife at Grafing Bahnhof, police said.

Police investigate the scene of a stabbing at a station in Grafing near Munich, Germany. Picture: AP Photo/Matthias Schrader

The incident happened shortly before 5am local time at the station, which is about 20 miles (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.

Earlier: One person has been killed and three others injured at a railway station near Munich by a knifeman shouting "Allah is great", German media have reported.

A police spokesman told the Bild newspaper that the attacker had been overpowered and arrested.

Broadcaster Bayrische Rundfunk reported that witnesses to the stabbings said the man shouted "Allahu Akbar".

The broadcaster said one of the victims was critically injured and died in hospital.

Three other victims suffered lesser injuries in the attack, which happened at around 5am local time.

Bayerische Rundfunk reported that the attacker is a young man who was not known to German police.