BERLIN — A knife-wielding man killed one person and injured three Tuesday at a commuter railway station in southern Germany, but investigators found no evidence that the assailant had ties to known militant cells and said he would undergo psychological tests.

Authorities said the suspect, a 27-year-old German, had yelled comments suggesting ties to Islamist factions — including “infidel, you must die” and “Allahu akbar” — during the attacks in the small Bavarian town of Grafing, about 25 miles southeast of Munich.

Lothar Kohler, a spokesman for the Bavarian Office of Criminal Investigation, told reporters that there was no evidence linking the attacker to Islamist militant networks or suggesting that “he was radicalized or incited” by videos or other sources.

The attacker has received psychiatric treatment in the past and told police he was under the influence of drugs at the time of the attack, investigators said. Mr. Kohler added, however, that the motive for the attack remains unclear.

Advertise with us

Judging by an ID card and documents found near the crime scene, the suspect — who was barefoot at the time — comes from the central German state of Hesse. It is unclear why he traveled to Grafing to carry out the attack.

“That it could happen here is absolutely stupefying,” Grafing Mayor Angelika Obermayr told The Associated Press, adding that Grafing is “an absolutely peaceful little Bavarian town.”

Prosecutor Ken Heidenreich said that the suspect was scheduled to be arraigned today and that a psychological examination would be carried out to establish whether he could be held criminally responsible. Authorities would then decide whether to issue an arrest warrant or temporarily hospitalize him.

The victims were between ages 43 and 58. A 56-year-old man died from his injuries shortly after arriving at a hospital.

Although the investigation appeared to veer away from terrorism, security agencies across Germany immediately took notice.

Advertise with us

The attack comes at a sensitive time in Germany after the influx of around 1.1 million migrants last year and growing concerns about how the country will deal with them, particularly in Bavaria, their usual state of entry.

Police in Germany have stepped up raids against suspected Islamist militants after terrorist attacks in Paris in November and bombings in Brussels in March — both linked to the Islamic State extremist group.

In February, a 15-year-old girl stabbed a police officer in the neck with a knife at a train station in the northern German city of Hanover. Germany’s federal prosecutor said the girl had been in contact with a Syrian-based Islamist militant group.

In August, a suspected Islamist militant armed with a knife and gun was subdued by passengers, including three Americans, on a journey from Amsterdam to Paris.

Associated Press and Deutsche Presse-Agentur contributed.