When intelligence officials briefed Iran's supreme leader Ayatollah Ali Khamenei in May ahead of a snap presidential election, their report was grim: angered by economic hardship and crackdowns on social freedoms, most Iranians planned to boycott the vote and turnout would only be about 13 per cent.
That's when Khamenei decided to carefully orchestrate the election, setting the stage for a little-known but trusted moderate, Massoud Pezeshkian, to rise to the presidency in a race that would initially be dominated by hardliners, five people with knowledge of the matter told Reuters.
Khamenei gathered a handful of his most trusted advisers to discuss his plan in at least three meetings in late May at his residence.
The supreme leader was concerned low turnout would damage the clerical establishment's credibility and he ordered those present to find a way to steer the election.
The election was called after president Ebrahim Raisi died in a helicopter crash in May.
His death upset the plans of many hardliners who wanted him to succeed the 85-year-old Khamenei and triggered a race among hardliners to influence the selection of the next supreme leader.
The meetings at Khamenei's residence included a small group of senior officials and security aides, his close ally and adviser Ali Akbar Velayati, as well as two senior commanders of the powerful elite Revolutionary Guards.
Khamenei believed Iran needed a president who could appeal to different layers of society, but would not challenge the ruling Shia theocracy.
Several names were floated at the second meeting. Khamenei suggested Pezeshkian as a person who could foster unity.
"It was a flawless plan by the supreme leader ... which guaranteed the survival of the Islamic Republic," said Teheran-based pro-reform analyst Saeed Laylaz.
"Pezeshkian will avoid any crisis at home, whether with the nation or the establishment," Laylaz said.
"That will allow top leaders to decide about the succession and plan it in a calm atmosphere."
The new president is not expected to usher in any major shift on Iran's nuclear or foreign policy, or its support for militias in the region, but he will be closely involved in selecting the successor to Khamenei, who calls the shots on top state matters.
Pezeshkian's mild profile, the sources said, would appease disgruntled Iranians, ensure domestic stability amid mounting foreign pressure, as well as providing Khamenei with a trusted ally in the eventual succession process.
The initial phase of Khamenei's plan was set in motion when then-lawmaker Pezeshkian — encouraged by pragmatic former officials with links to the supreme leader's office — registered to stand in the June 28 election, two sources said.
They said Pezeshkian was unaware of the behind-the-scenes decisions.
One source close to him said he didn't even expect to be approved by the Guardian Council, an unelected vetting body of six clerics and six jurists aligned to Khamenei.
Khamenei's plan was designed to appear fair and democratic, so two prominent hardline candidates, former nuclear negotiator Saeed Jalili and parliament speaker Mohammad Baqer Qalibaf, were approved by the vetting council.
That meant hardliner votes would likely be split, making it harder for both to make it to a run-off.
Jalili belongs to the ultra-hardline camp of "Paydari", which advocates tougher social restrictions, self-reliance and a hawkish foreign policy.
A win for Jalili, who opposed the 2015 nuclear deal with world powers, would have sent a negative signal to the West as it piles pressure on Teheran over its fast-advancing uranium enrichment programme.
"With the increased likelihood of Donald Trump's return to the White House ... the Islamic Republic needed a moderate figure to keep dialogue with the West open and reduce tensions," said one Western diplomat.
Pezeshkian, who is an Azeri ethnic minority, won the first round but voter turnout was just 40 per cent, the lowest for any election in the Islamic Republic. The election went to a run-off between Pezeshkian and Jalili. Qalibaf finished third.
Many Iranians who voted for Qalibaf, or abstained, went for Pezeshkian in the second round on July 5, bumping up the turnover to almost 50 per cent of Iran's 61 million voters.
Ultimately, Khamenei's plan achieved the desired outcome. Pezeshkian, a 69-year-old heart surgeon, backed by reformists, moderate conservatives and ethnic minorities, won with 54 per cent of the votes.
The writer is from Reuters
The views expressed in this article are the author's own and do not necessarily reflect those of the New Straits Times