One killed, three wounded in attack near Munich, Germany

Attack took place at 5am local time at train station in Grafing

Attacker reportedly shouted "Allahu akbar" and "you infidels!"

Suspect arrested, identified as German citizen, 27

Attacker "suffered from psychiatric issues

A German man shouting 'Allahu Akbar' stabbed one person to death and slashed three others in a dawn attack at a railway station in a sleepy commuter town near Munich.

The attack raised fears that Germany, which has not suffered a major terror attack on the scale of those in neighbouring France and Belgium, was now being targeted by Islamist extremists.

But police said that the 27-year-old unemployed carpenter named by local media as Paul H. was mentally disturbed and stressed that he had no known links to Islamist militant groups.

Police confirmed on Wednesday afternoon that the suspect would be held in a psychiatric hospital and not in a prison cell.

The man launched his knifing spree around 5:00 am local time in Grafing, 20 miles east of the Bavarian state capital.

He stabbed one man on a platform, another on a stopped train, then ran outside the station to slash two more.

One victim, a 56-year-old man, later died of his injuries in hospital.

According to reports, the attacker was barefoot and the bloody footprints seen in pictures of the station are his.

He told police he had taken drugs before the attack and claimed he had removed his shoes because "he felt bugs on his feet that had caused blisters and were generating intense heat", Police Director Lothar Köhler said.

Witnesses said the assailant, who was arrested at the scene shortly after the attack, shouted "Allahu Akbar" ('God is Greatest' in Arabic) and some said that they also heard him shout "infidels must die".

But police said that the assault appeared to be the work of a mentally unstable person, and that the attacker had received psychiatric treatment just two days ago and had confessed to using drugs.

"From what we know so far, he was a lone criminal ... There is no indication that he was part of an Islamist network," said Petra Sandles, of Bavaria's office of criminal investigations.

The attack, even if it turns out not to be Islamist motivated, will heighten fears in Germany that the country is being targeted by extremists.

With about 260 of the more than 800 home-grown radicals who have joined jihadist groups in Syria and Iraq having since returned to Germany, ministers have warned an attack is possible and security services are on alert.

Germany has taken in more than a million refugees fleeing wars in Syria and elsewhere, and some fear that extremists may have taken advantage of Europe's migrant crisis to enter the country.