The man is alleged to have spied on Jewish individuals and locations, particularly around three properties in Berlin.
The German prosecution authority writes in a statement that the man "received orders from the Iranian intelligence service" to gather information about Jewish individuals and locations, possibly with the intention of carrying out attacks.
The arrested man is suspected of having worked for the intelligence service of a foreign power.
Germany's Foreign Ministry summoned the Iranian ambassador on Tuesday due to the suspected espionage.
"We will not tolerate any threat to Jewish life in Germany", the ministry writes in a post on X and adds that the allegations need to be "thoroughly investigated".