A spokesman for the Federal Prosecutors Office says the suspects are believed to have "spied on institutions and persons in Germany on behalf of an entity associated with Iran."
The spokesman, Stefan Biehl, said that Tuesday's raids were prompted by a tip from Germany's domestic intelligence service.
He declined to comment on a report by weekly magazine Focus that the suspects were spying on Israelis in Germany.
At the beginning of January, Germany said it had summoned Iran’s ambassador to reprimand Tehran against spying on individuals and groups with close ties to Israel, calling such acts a completely unacceptable breach of German law.
The move comes after the March conviction of a Pakistani man for spying for Iran in Germany went into force.
Mustufa Haidar Syed-Naqfi was convicted of gathering intelligence on Reinhold Robbe, the former head of the German-Israel Friendship Society, and an Israeli-French economics professor in Paris, for Iran’s elite Revolutionary Guards.
The Foreign Ministry summoned the Iranian ambassador to deliver the unusually sharp rebuke once the German constitutional court rejected his appeal. The meeting took place on December 22 but was not disclosed until now.