The stormy Ahmadinejad era draws to a close Friday when Iranians vote for a new president, aware their ballot is unlikely to bring significant change but hoping it might make some difference to their precarious livelihoods.
Iran's unelected supreme leader, Ayatollah Ali Khamenei, has ensured that hardline candidates loyal to him dominate the field.
Yet, typical of Iranian presidential elections, no matter how tightly controlled, the contest has been fraught and the result is uncertain.
Hassan Rowhani, the sole moderate candidate, could yet upset the race after emerging as a possible wildcard. He won vital backing on Tuesday from two pro-reform leaders, Mohammad Khatami and Akbar Hashemi Rafsanjani, both former presidents. The latter was barred from running by a hardline vetting body.
The four hardliners competing for the presidency are now under pressure to unite behind a single candidate to avoid splitting the conservative vote. Prominent among them is Iran's uncompromising nuclear negotiator, Saeed Jalili, a protégé of the supreme leader. But polls indicate he is trailing Tehran's conservative mayor, Mohammad Baqer Qalibaf.
The vote is being closely watched in Western capitals for signs of what effect it could have on deadlocked nuclear negotiations between Iran and six world powers.
But the economy, battered by Western sanctions and fiscal mismanagement, is the main concern for voters.
Inflation is officially running at more than 30 per cent and unemployment is soaring, particularly among the young.
All six presidential hopefuls agree there must be no compromise on Tehran's right to enrich uranium for power generation, and none has questioned Iran's staunch support for the Syrian regime.
But, to the dismay of Ayatollah Khamenei, it became clear in a televised debate last week that they differ widely on how to handle nuclear negotiations. Mr Jalili was attacked for his nuclear diplomacy by another Khamenei loyalist, Ali Akbar Velayati. Such discord will encourage Western governments.
Meanwhile Mr Rowhani, a former nuclear negotiator, argued that a less confrontational foreign policy would allow Iran to advance its nuclear programme while easing Western concerns and allowing for sanctions to be rolled back.
The regime's immediate concern, however, is that the election passes smoothly. Iran's ruling establishment is scarred by the tempest that marred Mr Ahmadinejad's re-election four years ago when the reformist camp claimed it was robbed of victory by vote-rigging, igniting the biggest street protests since the 1979 Islamic revolution.
The peaceful uprising was crushed, but the system's legitimacy was badly tarnished at home and abroad.
For this reason, turnout on Friday is a major concern, with Ayatollah Khamenei equating a strong showing at the polls with trust in Iran's political system.
While the candidates are ardent supporters of the Islamic revolution, their views are far from uniform.
In televised debates there were disagreements over the economy, media censorship, academic and personal freedoms and nuclear policy.
If no one wins an outright majority, the vote goes to a run-off between the top two next Friday.