A German man, who officials said had drug and psychological problems, has stabbed one person to death and wounded three more at a railway station in a small town near Munich.

Bavarian radio said the attacker, identified locally as Paul H, used a knife with a 10cm blade in the apparently indiscriminate attack, which took place around 5am local time (0300 GMT) in Grafing, a commuter town about 32km southeast of the Bavarian capital in southern Germany.

Bavarian Interior Minister Joachim Herrmann said Tuesday's attack did not appear to be politically motivated.

The attacker, a 27-year-old from central Hesse state, was arrested at the scene.

"So far there are no findings that are relevant for state security," Herrmann said.

One of the victims, a 56-year-old man, died of his wounds in hospital.

Witnesses said the attacker shouted "Allahu Akbar" (God is greatest in Arabic), but Bavaria state's interior ministry said that "so far we have no evidence for an Islamist motive, but the investigation continues".

Bavarian radio said the attacker used a knife with a 10cm blade [Michaela Rehle/Reuters]

Town mayor Angelika Obermayr said she was "deeply shocked" at the crime in the 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.

"Something like that happening here is absolutely unbelievable."

Source: Agencies