Iran on Wednesday declared two German diplomats as persona non grata and ordered them to leave the country, accusing Berlin of interfering in Tehran's judicial affairs.
The move came after Germany expelled two employees of the Iranian embassy in Berlin last week in response to Iran sentencing a German national to death.
"The two German diplomats are being expelled due to Germany's irresponsible interference in Iran's internal and judicial affairs," state media quoted Iranian foreign ministry spokesman Nasser Kanaani as saying.
"The Islamic Republic of Iran will act firmly against excessive demands."
Germany has called on Iran to revoke the death sentence handed out to German-Iranian national Jamshid Sharmahd on charges of "corruption on earth". The verdict can be appealed.
Iran accuses Sharmahd, who also has U.S. residency, of heading a pro-monarchist group accused of a deadly 2008 bombing and planning other attacks in the country.
Tensions between Iran and the West have intensified in recent months, pushing already-stalled efforts to revive talks on Tehran's nuclear programme further into the background.
Germany has been a vocal backer of European Union sanctions against Iran over its crackdown on protesters in the country. The bloc plans to widen the measures to include Iranian actors involved in the Russian war in Ukraine.