Iran profile - full overview
Iran became an Islamic republic in 1979, when the monarchy was overthrown and clerics assumed political control under supreme leader Ayatollah Khomeini.
The Iranian revolution put an end to the rule of the Shah, who had alienated powerful religious, political and popular forces with a programme of modernization and Westernization coupled with heavy repression of dissent.
Persia, as Iran was known before 1935, was one of the greatest empires of the ancient world, and the country has long maintained a distinct cultural identity within the Islamic world by retaining its own language and adhering to the Shia interpretation of Islam.
In 2002, US President George W Bush declared Iran as part of an "axis of evil". While Mr Bush's successor, Barack Obama, adopted a less abrasive tone, Washington long continued to accuse Iran of trying to develop nuclear weapons.
Iran, which built its first atomic power station - at Bushehr, in the south of the country - with Russian help, insisted its nuclear ambitions were peaceful. Mahmoud Ahmadinejad, who was president from 2005 to 2013, maintained that Iran had an "inalienable right" to produce nuclear fuel.
Negotiations between Iran and six world powers - UN Security Council members US, UK, France, China and Russia, plus Germany - began in 2006 but did not produce an agreement until July 2015.
By 2010, the UN had imposed four rounds of sanctions on Iran in a bid to apply pressure on Tehran over the nuclear issue. The EU, US, Japan and South Korea also imposed their own sanctions on the country.
One of the most hard-hitting parts of the sanctions regime was the EU's ban on Iranian oil imports, which came into force in 2012. As the EU had until then received 20% of Iran's oil exports, this had a significant effect on the country's economy.
Iran has an abundance of energy resources - substantial oil reserves and natural gas reserves second only to those of Russia - and the targeting of this key sector, which had accounted for a large part of the state revenue, combined with Iran's isolation from the international banking system, caused the currency, the rial, to plummet in value. This in turn led to runaway inflation, and sent the prices of basic foodstuffs and fuel soaring.
Iran has been led by a highly conservative clerical elite since 1979, but appeared to be entering another era of political and social transformation with the victory of the liberals in parliamentary elections in 2000.
However, the reformists, kept on the political defensive by powerful conservatives in the government and judiciary, failed to make good on their promises.
The elections of June 2005 dealt a blow to the reformists when Mahmoud Ahmadinejad, Tehran's ultra-conservative mayor, became president.
Mr Ahmadinejad's controversial re-election in June 2009 and the violent suppression of subsequent opposition protests further widened the rift between conservatives and reformists within Iran's political establishment.
Hopes for more fruitful engagement with the rest of the world rose with the election of self-proclaimed moderate Hassan Rouhani to the presidency in 2013. Mr Rouhani declared soon after his election that although it was "good for centrifuges to operate", it was also important that "the wheels of industry" be kept turning.
With the domestic divide between moderates and hardliners continuing to represent a deep fault-line in Iranian society, Mr Rouhani's political survival came to be seen as very much dependent on the Iranian negotiating team's ability to strike a lasting deal with world powers over the nuclear issue.