The country's battered reformists have thrown their weight behind Hassan Rouhani, a moderate cleric favouring openness and improved relations with the West, who has emerged as the dark horse candidate in Friday's presidential election.
The former presidents Mohammad Khatami, seen as the leader of Iran's reformist movement, and Akbar Hashemi Rafsanjani publicly endorsed Rouhani on Tuesday.
"Bearing in mind my duty to the country and the fate of our honourable nation, I will give my vote to my esteemed brother Dr Rouhani," Khatami wrote. "I ask all, in particular the reformists and those who seek the dignity and elevation of the nation … to see Dr Rouhani's candidacy as a suitable chance for their demands to be met."
The endorsement of Rouhani has revived hopes among reformers seeking to return to the forefront of Iranian politics after the domination of hardliners during Mahmoud Ahmadinejad's eight-year presidency.
Last month as hundreds of hopefuls registered to stand for election, Khatami declined to run and declared support for Rafsanjani, who put his name forward but was disqualified on the grounds that he was too "feeble" to govern the country.
Critics said the decision against Rafsanjani's candidacy was politically motivated and stemmed from his rift with Iran's supreme leader, Ayatollah Ali Khamenei. Electoral officials also barred a close ally of Ahmadinejad, Esfandiar Rahim Mashaei. The president promised to take up Mashaei's case with Khamenei but has since remained unusually quiet.
After Rafsanjani's exclusion it was not clear whether reformists would unite behind another candidate, but it emerged later that Khatami and Rafsanjani were choosing between Rouhani and another moderate candidate, Mohammad Reza Aref.
Withdrawing from the race
On Monday Aref said he was withdrawing from the race at the request of Khatami, in what appeared to be a coordinated plan by reformers to avoid a split in the vote.
Unlike the reformists, Iran's conservatives have so far failed to unite. Of the other six candidates besides Rouhani and Aref, at least two identify themselves as independents.
Gholam-Ali Haddad-Adel, a so-called "principlist", also quit the race this week but did not endorse a particular contender. Tehran's mayor, Mohammad Bagher Ghalibaf, is among the conservative candidates seen as having a good chance of winning or entering a runoff with Rouhani.
The 65-year-old Rouhani is a former chief nuclear negotiator who has served as secretary of Iran's supreme national security council for 16 years. On Rouhani's watch Iran enjoyed better relations with the west and allowed more scrutiny of its nuclear programme.
In three debates on national television and his campaign speeches Rouhani has come across as strongly critical of Iran's current trajectory at home and abroad. He has expressed support for freedom of the press and said he would work to find a way out of the stalemate over Iran's nuclear dossier, which has prompted western powers to punish Tehran with unprecedented sanctions.
"I do not approve of the current foreign policy. We should try to have good international interactions to gradually reduce the sanctions and finally remove them," Rouhani said at a recent rally in the western province of Kurdistan.
Rouhani's supporters wear purple wristbands in a move reminiscent of the previous election, in 2009, when the opposition leader Mir Hossein Mousavi created massive momentum by going green.
Rouhani's open criticism
In a heated TV debate last Friday, Rouhani openly criticised Iran's handling of the nuclear talks. "All of our problems stem from this – that we didn't make the utmost effort to prevent the nuclear dossier from going to the UN security council," he said. "It is good to have centrifuges running, provided people's lives and livelihoods are also running."
To Rouhani's dismay, Iran's current top nuclear negotiator, Saeed Jalili, is also standing in a vote that many believe might turn into a referendum over Iran's nuclear programme. Many view Jalili as Khamenei's preferred conservative candidate but the supreme leader has said he has no favourite and sees any vote as a vote for the Islamic republic.
During Friday's TV debate Jalili's handling of Iran's nuclear negotiations came under attack from Ali Akbar Velayati, a conservative figure who advises Khamenei on foreign policy.
"What people are seeing, Mr Jalili, is that you have not gone forward even one step [in nuclear negotiations], and the pressure of international sanctions still exists. The art of diplomacy is to preserve our nuclear rights, not to see sanctions increase," Velayati said in comments that surprised many viewers.
In the absence of a explicitly opposition figure, however, many see the slate of candidates in Friday's vote as lacklustre, though there is no active plan for a boycott.
The elephant in the room of the Iranian election is the fact that two candidates in the disputed 2009 vote, Mousavi and Mehdi Karroubi, remain under house arrest. – © Guardian News and Media 2013