German police have arrested a 50-year-old Afghan-German man suspected of passing military secrets to Iran.
Federal prosecutors named the army linguist only as Abdul Hamid S. He is understood to have known details of German military operations in Afghanistan.
Prosecutors said he was suspected of "having passed on his knowledge to an Iranian intelligence service".
The EU has imposed sanctions on Iran for various alleged spying operations.
This month the EU put a unit of the Iranian intelligence agency and two individuals on the EU terrorist list, freezing their financial assets.
Iran says the accusations were fabricated to damage EU-Iran relations.
Abdul Hamid S. was arrested in Rhineland-Palatinate state in south-west Germany and, according to the Spiegel website, he is suspected of having worked for Iran for several years.
The German armed forces (Bundeswehr) have up to 1,300 personnel in the international security force in Afghanistan, with a mandate currently running until the end of March.
Based in Mazar-e-Sharif, a northern city, the German contingent's job is to train Afghan government troops, carry out surveillance and protect humanitarian missions. They have been involved in clashes with Taliban insurgents.
The Iranian state has been linked to several attacks and plots against Iranian dissidents in Europe, though Tehran rejects this.
In October, a German court backed the extradition of an Iranian diplomat suspected of involvement in a Paris bomb plot.