One person has been killed and several injured in a knife attack by a suspected Islamist at a railway station near Munich.

The suspect reportedly shouted “Allahu Akbar” (“God is great”) as he started stabbing passers-by in the town of Grafing, to the south-east of the German city.

The attack took place at around 4.50am (3.50am BST) on Tuesday and the suspected perpetrator was arrested shortly afterwards.

Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. (AFP/Getty Images)

The suspect, a 27-year-old German man, has been named locally as Paul H, from Giessen in the state of Hesse.

Joachim Herrmann, the Bavarian interior minister, said he had confessed to carrying out the atrocity.

He told the DPA news agency the suspect was not previously known to police for extremism but had psychological problems and drug issues.

A newspaper delivery worker was stabbed in the back during the "indiscriminate" assault, a firefighter told the Merkur newspaper.

The attack started on an S-Bahn train, where the first victim was injured, before the man stabbed another person inside the station and targeted two cyclists, witnesses told local media.

In pictures: Knife attack at German railway station Show all 10 1 /10 In pictures: Knife attack at German railway station In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AP In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AFP/Getty Images In pictures: Knife attack at German railway station Grafing attack A policeman walks past flowers, placed at the stairs of a train station, following a knife attack in Grafing train station Reuters In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AP In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. EPA In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AP In pictures: Knife attack at German railway station Grafing attack Two bicycles at the scene of a deadly knife attack at a railway station in Grafing, Bavaria, on 10 May 2016 EPA In pictures: Knife attack at German railway station Grafing attack Secured by forensic specialists of the German police a bicycle lays on the floor at the crime scene after a deadly knife attack in Grafing Getty Images In pictures: Knife attack at German railway station Grafing attack A forensic expert of the police is seen working in front of a bistro near the train station in Grafing Getty Images In pictures: Knife attack at German railway station Grafing attack A police officer takes pictures at the train station after an attack in Munich. One person has been killed and several injured after suspected Islamist stabbed passers-by at a railway station in Grafing Reuters

A spokesperson at the Bavarian state criminal investigation office told The Independent that a 56-year-old man was initially in a critical condition but died later in hospital.

Three other men aged 43, 55, and 58 were seriously injured, with one in a life-threatening condition.

A spokesperson for the state prosecutor's office confirmed that the attack was believed to have a political or "Islamist background" but could not give any further details.

Angelika Obermayr, the mayor of Grafing, told N-TV local people were in shock in the "quiet little town".

"Something like this is completely new and has shaken people deeply – it is something you only see on television," she added.

"That it happened here is completely incomprehensible."

Two bicycles at the scene of a deadly knife attack at a railway station in Grafing, Bavaria, on 10 May 2016 (EPA)

Dr Rüdiger Grube, the CEO of German railway company Deutsche Bahn, said the firm was “dismayed and saddened” and paid tribute to staff who intervened to stop the attacker as he tried to harm more people.

“Our deepest sympathies go to the relatives of the victim and those injured in the attack.

”My thanks go to our employees, who intervened courageously to prevent the perpetrator from carrying out further attacks.“

German authorities increased the nationwide terror alert level following November's Paris attacks, increasing security at transport hubs, tourist attractions and major events.

A police officer takes pictures at the train station after an attack in Munich. One person has been killed and several injured after suspected Islamist stabbed passers-by at a railway station in Grafing (Reuters)

Two railway stations in Munich were evacuated temporarily on New Year's Eve in an alert over an alleged suicide bombing plot by Isis supporters.

More than 800 German jihadists are believed to have joined Isis and other terrorist groups in Iraq and Syria.

Isis has also issued propaganda directed at supporters in the country, including one video calling for them to travel to Syria or wage terror attacks at home.

A German-born militant who grew up in the UK appeared in the footage and spoke about the "staged" experience in an exclusive interview with The Independent.

The video showed a jihadist calling on supporters, in German, to “pick up a big knife, go down to the streets and slaughter every infidel you encounter”.

Authorities have not confirmed any link between the attack in Grafing and Isis.