Editor's note: Alex Vatanka is a specialist in Middle Eastern affairs at the Middle East Institute in Washington DC.
(CNN) -- This past Friday, Iran held the third and last presidential debate before polling day on June 14. Unlike the previous two debates, the question of Iranian foreign policy took center stage. This turned the debate into one of the most animated political clashes aired on Iranian state-run television in years.
Exchanges were so heated that the candidates were later accused of having revealed national secrets during the debate. One candidate linked with the reformist movement, Hassan Rouhani, has since been warned that he may be barred from running in the elections because of confidential material he revealed about Iran's nuclear program during the two hour-long debate.
Critics will dismiss the presidential debates held in Tehran as mere theatrics. The eight candidates [now six after Gholam-Ali Haddad-Adel and Mohammad Reza Aref withdrew this week] have, after all, been carefully approved by the Guardian Council -- the regime's top vetting agency -- and cannot therefore be considered as individuals likely or able to greatly shift the trajectory of the foreign policy of the Islamic Republic. From the perspective of the critics, the elections on June 14 are just window dressing by Iran's Supreme Leader, the unelected Ayatollah Ali Khamenei whose stringent Islamism and anti-Western worldview has characterized his tenure since he came to power in 1989.
The reservations held by the critics are perfectly justified. The June 14 elections are undeniably tightly orchestrated. Some 678 individual hopefuls were after all barred to even enter the race. Nevertheless, there is also no doubt that the eight men who were admitted to the race do not see eye-to-eye about the regime's foreign policy record or the best path ahead for this large Middle Eastern country of 76 million people.
In this third debate, the then-eight candidates threw some convincing punches, smearing the record and policy plans of each other in a spiteful battle to lead the pack. The conventional fault line separating reformists from hardline candidates was very hard to detect, with the most bitter exchanges taking place among hardliners.
One of the most heated exchanges took place between Ali Akbar Velayati, foreign minister from 1981 to 1997, and Saeed Jalili, who is judged by many to be favored by Ayatollah Khamenei. Jalili has been leading Iran's nuclear negotiation team since 2007. Velayati questioned Jalili's diplomatic aptitude, accusing his team of pointless intransigence when negotiating with the world powers about Iran's nuclear program. "Negotiations are about give-and-take and not about reading out loud your own manifesto," Velayati shouted at Jalili.
Velayati's charge was remarkable because the bland Jalili -- who has no political base of his own -- has over the years been regarded to simply represent the views of Supreme Leader Ayatollah Khamenei. Meanwhile, all the candidates agreed that Tehran has to adjust its nuclear posture during negotiations but no one raised the logic behind having the program in the first place. That would be breaking one taboo too many and Ayatollah Khamenei has made it clear he will not allow the regime to give up the program.
Another taboo that was nearly broken came when Mohsen Rezaei, a long-time former commander of Iran's feared Islamic Revolutionary Guards Corps (IRGC), accused Jalili of having wasted an opportunity to reach a compromise with the Americans when the two sides met in Baghdad in May 2012.
Here was Rezaei, who led the IRGC when Jalili was barely a teenager in the heyday of Iran's anti-Americanism in the early 1980s, speaking of not meeting with the Americans but compromising with them as well. No one would have blamed Rezaei if he had argued for less interaction with the world. Rezaei is after all the only candidate for whom there is a valid "Red Notice" -- issued by Interpol at the request of Argentina, for his alleged role in the 1994 terrorist attack against a Jewish cultural center in Buenos Aires. And yet even Rezaei argued against Iranian isolationism.
Among the candidates, points of agreement were few and far between but all eight men agreed on one point: that the 8-year record of sitting President Mahmoud Ahmadinejad had been a disaster for Iran. Ahmadinejad was blamed for pursuing an unnecessarily adventurist, incompetent and costly foreign policy.
Each candidate made the claim that Ahmadinejad's bombastic sloganeering abroad could not hide the lack of substance behind his actions. Attacks on Ahmadinejad's performance have become so prolific that the sitting president has asked for airtime on national television to defend his record. On Saturday, Ahmadinejad went further and said he "had nothing to do with the nuclear program" and "someone else is responsible for it."
This was an abdication of responsibility and the "someone else" was an obvious reference to Ayatollah Khamenei. No Iranian politician can look the Iranian people in the eye and take credit for the painful economic sanctions, which have come about as a result of the nuclear standoff.
And Ahmadinejad has a point. He can't blame all of his many shameful statements on Khamenei -- such as denouncing the Iranian Green opposition as "dirt" or denying the Holocaust -- but the fact is he never single-handedly controlled Iran's nuclear policy. The presidency in the Islamic Republic just does not have that kind of clout.
The main message from the debate is that Iranian foreign policy is in shambles and a new page has to be turned. There were differences in nuance and each candidate claimed particular strengths but the consensus is that Iran cannot become another North Korea.
As Velayati put it "it is good that we now have circles of friendly states in Africa and Latin America, but that is not enough." Again and again, the need to overhaul ties with the United States and European countries was raised, leading at times to shouting matches about which candidate has the knack to defuse the crisis with the Western world.
Nevertheless, while there was broad agreement that Iran has to do a far better job at paving the path for a compromise with the West, no one directly touched the elephant in the room: the role of the unelected Ayatollah Ali Khamenei in shaping Iran's foreign policy. They did so only in a roundabout way. All admitted that Khamenei is a central voice in any strategic decision-making and yet no one dared to openly question the wisdom of the 73-year old Supreme Leader.
But if Khamenei watched this third debate -- as he surely did -- then he could not have missed the writing on the wall. Even among these very carefully regime-approved candidates the cry for an overhaul of Iranian foreign policy could not have been any louder.