Iran has released a German citizen as part of a prisoner swap for an Iranian held in Germany on suspicion of violating US sanctions. It made the announcement on Tuesday and the exchange has taken place over the last two days. The move was on condition Germany did not extradite its citizen to the US. Iran's judiciary spokesman Gholamhossein Esmaili told a televised news conference: "We announced that we are ready to (release) this German national... on condition that they (the Germans) do not extradite our citizen to America. "On Sunday... the Iranian national left Germany and entered Iran, and on Monday... we released the German national." According to the official, the unidentified German had been detained "for some time" for "taking photos and videos" in areas without authorisation and had been serving a three-year prison sentence. The German was swapped for Iranian Ahmad Khalili, who according to Iran's foreign ministry was detained in Germany "on the pretext of violating the illegal and cruel sanctions of the United States". Khalili was freed on Sunday night after "intensive diplomatic consultations" and cooperation involving the judiciary and the Revolutionary Guards' intelligence service, ministry spokesman Abbas Mousavi said in a statement. He returned to Iran together with Foreign Minister Mohammad Javad Zarif, who last week attended a security conference in the German city of Munich, Mousavi added. Iran said in December it was ready for more prisoner swaps with the US after it secured the return of scientist Massoud Soleimani in exchange for Xiyue Wang, a Chinese-born American held in the Islamic republic. Decades-old tensions between Tehran and Washington have escalated steeply since 2018, when US President Donald Trump unilaterally withdrew from a landmark 2015 nuclear deal and reimposed sanctions on Iran. Soleimani, a stem cell researcher at a Tehran university, on December 7, also flew back home from the United States with Mr Zarif.