Iran’s foreign minister apologized Sunday for recorded comments that were leaked to the public last week that offered a blunt appraisal of the country's power struggles, sparking a political firestorm in Iran less than two months before presidential elections and apparently drawing the ire of Iran's supreme leader.

The recordings of Mohammad Javad Zarif included frank comments about the powerful late Iranian Gen. Qassem Soleimani, who was killed by a U.S. drone strike in Iraq last year, as well as criticism of his polices in Syria and his relations with Russia.

"I hope that the great people of Iran and all the lovers of General (Soleimani) and especially the great family of Soleimani, will forgive me," Zarif said in an Instagram post.

US DENIES REPORT OF IRAN PRISONER SWAP DEAL, RELEASE OF $7B IN FROZEN FUNDS

In a speech broadcast later Sunday, Iran’s supreme leader Ayatollah Ali Khamenei appeared to lambast Zarif for departing from the official line, although he didn't call him out by name.

"It's a big mistake that must not be made by an official of the Islamic Republic," Khamenei said in veiled reference to the leaked comments. "Some remarks have been heard from officials that are regrettable and surprising."

He added: "Some of these comments are a repetition of what Iran’s enemies say."

Zarif’s leaked comments sent shock waves through Iran, where officials mind their words amid a cut-throat political environment that includes the powerful Revolutionary Guard, ultimately overseen by the country’s supreme leader. Zarif's criticism of the revered Soleimani, whose funeral processions in Iran drew millions of people to the streets, ignited instant controversy.

In the recordings, Zarif takes issue with Soleimani’s relations with Russia, which he accused of trying to sabotage Tehran's 2015 landmark nuclear deal with world powers. He also denounces Soleimani’s refusal to stop using the U.S.-sanctioned national carrier, Iran Air, for operations in war-torn Syria over Zarif’s objections.

CLICK HERE TO GET THE FOX NEWS APP

Zarif can be heard stressing at various points in the seven-hour tape that it was not meant for release.

"If I had known that a sentence of it would be made public, I certainly would not have mentioned it as before," he said in a remorseful Instagram post.

Speculation had mounted in recent weeks that Zarif, the Iranian official perhaps most closely associated with the now-tattered nuclear agreement, would challenge hard-liners in the upcoming vote. Khamenei’s apparent censure of the foreign minister casts doubt over any potential presidential ambitions, as the Guardian Council, a body of senior clerics and legal experts that serves under Khamenei, vets candidates for office. Zarif has insisted he doesn’t want to run.