Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

MAINZ, Germany — A man armed with a knife killed one person and wounded at least three others in a dawn attack at a train station near Munich early Tuesday, officials said.

A witness said the suspect shouted “Allahu Akbar” — which means “God is great” in Arabic — but authorities later said he had no known link to a terrorist organization.

The German-born 27-year-old — who was not immediately identified — was arrested after the incident in Grafing, a suburb about 25 miles east of Munich's city center. According to authorities, he was armed with a four-inch knife.

A map showing the Munich suburb of Grafing, Germany. Google Maps

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The attack happened at the S-Bahn commuter station at 5 a.m. local time (11 p.m. Monday ET).

Karl-Heinz Segerer, a spokesman for Bavarian State Police, said one man was stabbed on the train and a second victim was targeted on the platform. The suspect also stabbed two other men who were on bicycles at the entrance to the station.

The 56-year-old man stabbed on the train later died from his injuries, police spokesman Hans-Peter Kammerer said.

Bavaria’s interior minister, Joachim Herrmann, said the suspect had recently been stopped by police in another part of Germany because of his behavior and on suspicion of drug use.

"So far there are no findings that are relevant to state security about this person," he told reporters, adding that the suspect did not appear in any database of Islamists or ISIS sympathizers.

Prosecutor Ken Heidenreich told a news conference that the suspect's statements were inconsistent and that they are doubtful as to whether he can be held criminally responsible.

He was being medically evaluated to determine if he is fit to stand trial in court and whether he should be placed in a jail during pre-trial custody or in a psychiatric facility.

While the exact motive behind the incident remains unclear, authorities in Germany have been on alert for possible “lone wolf” terrorist attacks.

The knife attack happened at this S-Bahn station in Grafing, a suburb of Munich. Reuters

Hans-Georg Maassen, the head of Germany’s domestic intelligence (BfV), said last week that ISIS was following a “dual strategy” by planning both major attacks and “do-it-yourself” terrorists who are radicalized by the terror group’s online propaganda.

He cited the case of a 15-year-old Muslim girl, only identified as Safia S., who was arrested for attacking a German police officer with a knife at Hanover train station in February.

Prosecutors allege the girl, who was overpowered by another officer, was acting in the name of ISIS.