BERLIN (AP) — A man armed with a machete was overwhelmed and arrested after threatening to kill officers at a police station in western Germany early Friday, prosecutors said. Investigators said they believe he had an Islamic extremist motive.

The 29-year-old Albanian citizen arrived at the police station in the small town of Linz am Rhein, between Koblenz and Bonn, at about 2:40 a.m. Prosecutors said he repeatedly shouted “Allahu akbar” — "God is great” in Arabic — and said he wanted to kill police officers.

Get The Latest News!

Don't miss our top stories and need-to-know news everyday in your inbox.

Article continues after sponsor message

Police officers who were on guard duty locked the police station's door and the entrance to its interior courtyard. The suspect tried and failed to force them open, prosecutors said in a statement. Special forces officers were called to the scene and subdued him with a stun gun.

Investigators who searched the suspect's apartment found a flag of the Islamic State group drawn on a wall.

The incident in Koblenz follows an Aug. 23 knife attack in the western city of Solingen in which a suspected extremist from Syria is accused of killing three people. A man killed in a shootout with police officers near the Israeli Consulate in Munich on Thursday also is suspected to have been radicalized.