As a young prosecutor in Tehran, Ebrahim Raisi sat on a "death committee" overseeing the execution of hundreds of political prisoners in the Iranian capital, rights groups say.
Now president three decades later, and seen by many as Iran's potential next Supreme Leader, Raisi is presiding over an uncompromising response to domestic and international challenges which have seen Iranian courts pass dozens of death sentences.
Four people have been hanged after being convicted on charges related to popular unrest that erupted in September over the death in police custody of Mahsa Amini, a 22-year-old Kurdish Iranian woman. On Saturday, Iranian media said former Defence Ministry aide Alireza Akbari was executed for spying.
The executions triggered condemnation from Europe and the United States, but Raisi has insisted that "identification, trial and punishment" of all those who authorities believe were involved in violence will continue.
"The executions are aimed at creating a republic of fear in which the people don't dare to protest and the officials don't dare to defect," said Ali Vaez, the International Crisis Group think-tank's Iran Project Director.
Akbari, who had acquired British nationality and was living abroad, was "lured back" and arrested three years ago, Britain's foreign minister James Cleverly said this week.
Raisi is overseeing an unyielding crackdown on the unrest, in which campaigners say more than 500 protesters and dozens of security force personnel have been killed, echoes his role in a purge of political prisoners in 1988.
Then, in a few weeks following the July ceasefire which ended eight years of war with Iraq, Iranian authorities conducted secret mass executions of thousands of imprisoned dissidents and opponents of the Islamic Republic.
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 which lasted just a few minutes, according to a report by Amnesty International.
While the number of people killed across the country was never confirmed, Amnesty said minimum estimates put it at 5,000.
Raisi, then deputy prosecutor general for Tehran, was a member of the capital's death committee, according to Amnesty.
Human Rights Watch, in a report published last year, quoted a prisoner saying he saw Raisi at a prison outside Tehran and that Raisi would go to the execution site to ensure the process was carried out correctly.
Asked in 2021 about allegations he was involved in the killings, Raisi said: "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."
The presidential office did not immediately respond to a request for comment on this article.
Iranian officials acknowledged the executions but played down the scale. In February 1989, President Akbar Hashemi Rafsanjani said that "less than 1,000 were executed". In 2016, another member of the Tehran "death committee" said, "We are proud to have carried out God's order,” state media reported.
"Raisi has been brought up as president for a few reasons, including his brutality, loyalty, and lack of conscience. He showed these characteristics in 1988," said Saeid Golgar of the University of Tennessee at Chattanooga.
"He is entirely on board with political repression."
SANCTIONED BY US
Raisi was born in 1960 to a religious family in Iran's northeastern Shi'ite Muslim city of Mashhad. He lost his father at the age of five, but followed his footsteps to become a cleric.
As a young student at a religious seminary in the central holy city of Qom, he joined 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.
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 pragmatic incumbent Hassan Rouhani in a 2017 election. His failure was widely attributed to a then 28-year-old audio tape that surfaced in 2016 and purportedly highlighted his role in the 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's 2021 presidential campaign ended in a victory which brought all branches of power in the country under the control of hardliners loyal to Supreme Leader Ayatollah Ali Khamenei for the first time in years.
His election win appeared to burnish Raisi's chances of one day succeeding the 83-year-old Khamenei, but some analysts and insiders believe that his failure to boost an ailing economy and his foreign policy difficulties have damaged his prospects.
Khamenei, not the president, has the final say on all major policy under Iran's dual political system split between the Shi'ite clerical establishment and the government.
Raisi "is not driving the repression. He's an instrument of it," ICG's Vaez said.
But his hardline stance, closely aligned with Khamenei, helped guide policy abroad as well as at home.
Since his election, Iran has played hardball in negotiations to salvage its tattered nuclear deal with world powers, betting it has the leverage to win wide sanctions relief in return for curbs on its increasingly advanced uranium enrichment technology.
Khamenei threw his weight behind the original 2015 deal negotiated by the government of pragmatist Rouhani, winning a temporary lifting of Iran's economic and political isolation.
But in 2018 then-President Donald Trump withdrew the United States from the pact and reimposed sanctions, saying the deal - reached before he took office - was too lenient on Tehran