A Syrian man suspected of planning a terror attack was detained in the northern German city of Schwerin, the Federal Prosecutor's Office said on Tuesday in a statement.

The suspect, identified as 19-year-old Yamen A., was taken into police custody.

Prosecutors said in a statement that the teen is "strongly suspected of having planned an Islamist-motivated attack" that involved "highly explosive" materials. Authorities added that Yamen A. had already "concretely prepared" the attack.

Read more: Preventing terrorism: What powers do German security forces have?

In July this year, the suspect made the decision to detonate an explosive device in Germany "in order to kill and injure as many people as possible," the statement read.

Yamen A. then began to procure components to make an explosive device, including chemicals. It was not initially clear whether the suspect had selected a location to carry out the attack, prosecutors said.

They added that there are no signs that Yamen A. was connected to any terrorist organizations.

German Interior Minister Thomas de Maiziere said the suspect's arrest prevented a "serious terror attack in Germany."

He noted that the arrest occurred "at the right time — late enough to secure evidence and at the same time early enough to reliably avert danger."

De Maizeire said that the terror threat posed by Islamic extremists in Germany and Europe remains "unchanged at a high level."

Apartments searched in Hamburg and Schwerin

The man's apartment as well as the apartments of others not yet suspected of involvement in planning the attack have been searched in Schwerin and the city of Hamburg.

Prosecutors were set to give a press conference later on Tuesday.

Read more: Masoud's list revisited — 'IS' victim turns terrorist hunter in Germany

Germany was hit by several attacks in 2016, including one in December where a Tunisian man drove a stolen truck into a crowded Christmas market in Berlin, killing 12 people.

Last July, a 27-year-old Syrian refugee detonated an explosive device outside a music festival in the southern German town of Ansbach, killing himself and wounding 15 people.