Two of the men had "decided in late 2018 to carry out an attack in Germany," a prosecutors said in a statement.
"According to the investigation so far, the accused had not yet chosen a target for their attack. "Whether the accused belonged to a terrorist group must now be clarified."
The suspects were identified only as Shahin F. and Hersh F., both aged 23, and their alleged supporter, the 36-year-old Rauf S.
They were detained in early-morning raids in Dithmarschen, Schleswig-Holstein state, near the Danish border.
Shahin F. had allegedly accessed bomb-building manuals online and asked a contact in Britain to send him a fuse, a plan that was however foiled by UK police.
German Muslim groups ask for support after mosque attacks
He and Hersh F. had also collected explosive material from fireworks, said authorities.
And they had asked Rauf to procure a gun, but rejected as too expensive a Makarov 9mm weapon on offer from a man identified as Walid Khaled Y.Y. in the statement.
Because the Iraqi men had wanted to use a vehicle in their attack, Shahin F. had also started driving lessons early this year, said prosecutors.
Police also carried out related raids in the states of Mecklenburg-Pommerania and Baden-Wuerttemberg.
News site Spiegel Online reported, quoting unnamed security sources, that the men had arrived in Germany in the autumn of 2015, at the height of the refugee influx that brought over a million asylum seekers.
One of the suspects had allegedly spoken of wanting to target the largest possible group of "non-believers, but not children", Spiegel Online said.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ