The man, identified only as Yamen A., was held at dawn by special forces in the northeastern town of Schwerin, the federal prosecutors office said in a statement. Several apartments were also searched in the region, which is north of Berlin.
The man is suspected of having "planned and already concretely prepared an Islamist-motivated attack in Germany using very powerful explosives," the statement said.
"It has not yet been established whether the suspect already had a target in mind or not," it said, adding that prosecutors did not have any information whether the suspect belonged to "a terrorist organisation."
In the following weeks, he began to acquire the chemical products and materials necessary to build a bomb.
More From This Section
German police have been on high alert to the threat of Islamist attacks, particularly after a truck rampage claimed by the Islamic State group killed 12 people in Berlin last December.
A report published in September found that Berlin authorities had missed several opportunities to arrest and deport the driver, Tunisian asylum seeker Anis Amri.