Iranian President Ebrahim Raisi, whose helicopter crashed in mountainous terrain on Sunday, has become a contender to be Iran's next supreme leader with a clampdown on morality questions and a bloody crackdown on the nationwide protests it triggered.
Raisi's victory in an election in 2021, after heavyweight conservative and moderate rivals were disqualified by a hardline oversight body, brought all branches of power under the control of hardliners loyal to Supreme Leader Ali Khamenei, Raisi's 85-year-old mentor, who has the final say on all major policies.
Raisi, 63, took a tough stance in now-moribund negotiations with six major powers to revive a 2015 nuclear deal, seeing a chance to win broad relief from US sanctions in return for only modest curbs on Iran's increasingly advanced nuclear programme.
Hardliners in Iran have been emboldened by the chaotic US military withdrawal from neighbouring Afghanistan and policy swings in Washington.
In 2018, then-US president Donald Trump had reneged on the deal Tehran had done with the six powers and restored harsh US sanctions on Iran, prompting Tehran to progressively violate the agreement's nuclear limits.
Indirect talks between US President Joe Biden's administration and Tehran to revive the pact have stalled.
Raisi's hardline position has also been evident in domestic politics; a year after his election, the mid-ranking cleric ordered that authorities tighten enforcement of Iran's "hijab and chastity law" restricting women's dress and behaviour.
Within weeks, a young Kurdish Iranian woman, Mahsa Amini, died in custody after being arrested by morality police for allegedly violating that law.
The resulting months of nationwide protests presented one of the gravest challenges to Iran's clerical rulers since the 1979 Islamic Revolution.
Hundreds were killed, according to rights groups, including dozens of security personnel who were part of a fierce crackdown on the demonstrators. "Acts of chaos are unacceptable," the president insisted.
Although a political novice, Raisi has had full backing for the nuclear stance and the security crackdown from his patron, the strongly anti-Western Khamenei.
However, the widespread protests against clerical rule and a failure to turn around Iran's struggling economy - hamstrung by Western sanctions and mismanagement - may have diminished his popularity at home.
'PILLAR OF THE SYSTEM'
As a young prosecutor in Tehran, Raisi sat on a panel that oversaw the execution of hundreds of political prisoners in the Iranian capital in 1988, as Iran's eight-year war with Iraq was coming to an end, rights groups say.
Inquisitions known as "death committees" were set up across Iran comprising religious judges, prosecutors and intelligence ministry officials to decide the fate of thousands of detainees in arbitrary trials that lasted just a few minutes, according to a report by Amnesty International.
While the number of people killed across Iran was never confirmed, Amnesty said minimum estimates put it at 5,000.
Asked about allegations that he had played a part in the death sentences, Raisi told reporters in 2021: "If a judge, a prosecutor, has defended the security of the people, he should be praised ... I am proud to have defended human rights in every position I have held so far."
He rose through the ranks of Iran's Shi'ite Muslim clergy and was appointed by Khamenei to the high-profile job of judiciary chief in 2019. Shortly afterwards, he was also elected deputy chairman of the Assembly of Experts, the 88-member clerical body responsible for electing the next Supreme Leader.
"Raisi is a pillar of a system that jails, tortures and kills people for daring to criticize state policies," said Hadi Ghaemi, executive director of New York-based advocacy group the Centre for Human Rights in Iran (CHRI). Iran denies torturing prisoners.
Raisi shares with Khamenei a deep suspicion of the West. An anti-corruption populist, he backs Khamenei's self-sufficiency drive in the economy and his strategy of supporting proxy forces across the Middle East.
When a missile attack killed senior Iranian Revolutionary Guard officers in Iran's embassy in Damascus in April, Iran responded with an unprecedented but largely unsuccessful direct aerial bombardment of Israel.
Raisi said that any Israeli retaliation against Iranian territory could result in there being nothing left of the "Zionist regime".
"Raisi is someone that Khamenei trusts," said Sanam Vakil, deputy director of Chatham House’s Middle East and North Africa Program. "Raisi can protect the supreme leader's legacy.
Raisi served as deputy head of the judiciary for 10 years before being appointed prosecutor-general in 2014. Five years later, the United States imposed sanctions on him for human rights violations, including the 1980s executions.
Seeking the presidency, Raisi lost to the pragmatist Hassan Rouhani in a 2017 election. His failure was widely attributed to an audio tape dating from 1988 that surfaced in 2016 and purportedly highlighted his role in the 1988 executions.
In the recording, the late Ayatollah Hossein Ali Montazeri, then deputy supreme leader, spoke of the killings. Montazeri’s son was arrested and jailed for releasing the tape.
Raisi was born in 1960 to a religious family in Iran's holy Shi'ite Muslim city of Mashhad. He lost his father at the age of 5, but followed in his footsteps to become a cleric.
As a young student at a religious seminary in the holy city of Qom, Raisi took part in protests against the Western-backed Shah in the 1979 revolution. Later, his contacts with religious leaders in Qom made him a trusted figure in the judiciary.