The man was seized Wednesday in a raid in the Lower Saxony town of Northeim.
He is a German national said to be active in the radical Salfist scene.
The allegedly told police after his arrest: “I wanted to slay them with it.”
In the first interrogation prosecutors said he admitted planning an attack on police officers or soldiers.
He did this with a homemade explosive device “and wanted to lure them into a trap”, said the prosecutor’s office in the town of Celle.
He is being held on suspicion of preparing a serious crime against the state.
Chemicals needed to make a bomb were found in his flat, including acetone peroxide, and electronic components capable of detonating a device by remote control.
The suspect is being held in a police facility in the university city of Göttingen while police scramble to round up his contacts and associates.
Göttingen’s Chief of police Uwe Lührig stated that the fight against terrorism and radical Islamism had top priority.
Just two weeks ago, two men suspected of planning terrorism were arrested in Göttingen.