Ten events that changed Iran since the Islamic Revolution
This power struggle between the centre and right in Iran has been shaped by events since the 1979 Islamic Revolution, which has seen one side gain prominence over the other.
With Friday's election closing in, here are ten key dates in the country's history since 1979:
1979: The revolution
On 11 February 1979 the US-backed shah's government falls, ten days after the triumphant return from exile of revolutionary leader Ayatollah Ruhollah Khomeini. An Islamic republic is proclaimed on 1 April.
1979: US hostage crisis
Pro-Khomeini students take 52 Americans hostage at the US embassy in Tehran on 4 November 1979, prompting Washington to sever diplomatic relations in 1980. The hostages are freed on 21 January 1981, after 444 days in captivity.
1980: Iran-Iraq war
On 22 September 1980, Iraq invades Iran after its president Saddam Hussein tears up a 1975 treaty on the strategic Shatt al-Arab waterway, triggering an eight-year war that kills a million people.
The conflict, one of the longest and most deadly in the Middle East, ends on 20 August 1988 with a UN-brokered ceasefire.
1989: Khomeini dies
Khomeini dies on 3 June 1989. Ayatollah Ali Khamenei, president since October 1981, becomes supreme leader of the Islamic Republic.
Moderate conservative Akbar Hashemi Rafsanjani is elected president. Re-elected in 1993, he orchestrates a relative opening up of the regime.
1995: American embargo
On 3 April 1995, Washington decrees a total trade and financial embargo on Iran, which it accuses of backing terrorism.
US president George W. Bush places Iran on a list of "axis of evil" states on 29 January 2002.
1997-2005: Political stand-off
Rafsanjani's reformist successor, Mohammad Khatami, runs up against conservative opposition during his two terms from 1997 to 2005, amid a dogged stand-off between conservatives and reformists. In July 1999, the regime faces the biggest protests since 1979, with students who back Khatami clashing with riot police.
2005: Ahmadinejad era begins
On 25 June 2005, ultra-conservative Mahmoud Ahmadinejad is elected president.
During his terms, Iran begins uranium enrichment, alarming the West which suspects Tehran of wanting to make a nuclear weapon. Between 2006 and 2010 the UN adopts six resolutions on Iran, four of which include sanctions.
2013: Rouhani, Obama talk
The election of moderate cleric Hassan Rouhani on 15 June 2013 marks a warming of relations with Washington. On 27 September Rouhani and US President Barack Obama talk by phone, contacts unprecedented at this level since Iran's revolution.
2015: The nuclear deal
An accord with world powers on Iran's nuclear programme is reached on 14 July 2015, ending 13 years of crisis and 21 months of protracted negotiations. It gives Tehran relief from crippling economic sanctions in exchange for limits on its nuclear programme, and comes into force on 16 January 2016.
2016: Break with Saudi
In early January, Iran's regional rival Saudi Arabia and its allies break off or scale back their diplomatic relations with Tehran after a crisis prompted by Riyadh's execution of Shia cleric Sheikh Nimr al-Nimr.
Since then, Iran has been accused of interfering in the affairs of the Arab countries and of fanning conflict in Syria, Iraq, Yemen and Bahrain - an allegation it denies.