Turkish-Iranian gold trader Reza Zarrab had been due to go on trial over the accusations but, to Turkey's chagrin, he agreed to cooperate with US prosecutors and told a court on Thursday that Erdogan authorised two Turkish banks to circumvent the sanctions and launder money from Iran.
The case has angered Erdogan, who accused the trial of being linked to the network of Fethullah Gulen, the US-based Muslim cleric blamed by the Turkish government for last year's failed coup.
"My country can never be condemned by virtual courts set up by FETO scoundrels, fake representatives," Erdogan said during a televised speech in the eastern city of Kars, referring to Gulen's group that Turkey has dubbed the "Fethullah Terrorist Organisation".
"Someone has got up and decided they will apparently try my country in their falsely set-up courts. Don't bother!" Erdogan added.
Turkey has repeatedly called for Gulen to be extradited, but he denies any involvement in the coup or terrorism.
Since Zarrab became the prosecution's star witness in the trial, deputy chief executive of Turkish lender Halkbank Mehmet Hakan Atilla is now the lone man in the dock accused of violating sanctions, bribery and money laundering.
Zarrab has taken the stand three times since Wednesday, admitting to bribing a former Turkish economy minister and being involved in the multi-billion-dollar gold-for-oil scheme.
On Thursday he told the court he was informed that in 2012, then prime minister Erdogan and then treasury minister Ali Babacan had given "instructions" for two other Turkish public banks, Vakif and Ziraat, to take part in the scheme.
Zarrab was a key figure in a 2013 Turkish corruption scandal, which Ankara denounced at the time as another conspiracy by Gulen and his group.
Analysts say the embarrassing revelations could damage Erdogan politically and also harm the Turkish economy, if one or more Turkish banks are fined over violating sanctions.
Ankara has urged Zarrab to "turn back from his mistake" and claimed this week that the trader is under pressure to make defamatory claims against Turkey.
Istanbul's public prosecutor ordered the seizure of Zarrab and his family's assets late on Friday, accusing him of "espionage" for the benefit of a foreign state.
Turkish Foreign Minister Mevlut Cavusoglu earlier on Saturday claimed "FETO has infiltrated American missions in Turkey, the US judiciary, its Congress, everywhere, they have infiltrated all institutions in this or that way, legally or illegally."