For Iran's supreme leader Ayatollah Ali Khamenei, seeking a return to the nuclear deal before his protege Ebrahim Raisi becomes president in August is a win-win strategy.
It would secure sanctions relief and allow the new administration to maintain its anti-western stance.
The affinity between the two men goes back to 1989, when Mr Raisi was appointed as Tehran's prosecutor in the same year Mr Khamenei became supreme leader.
Their relationship is also based on their shared ultra-conservative ideology, solid relations with the Islamic Revolutionary Guard Corps and a long record of empowering Iran’s hardline judiciary while suppressing dissent.
The incoming president was a member of a four-man "death committee" in the 1980s that executed political detainees with no due process.
His rapport with Mr Khamenei helped Mr Raisi become the head of Iran’s powerful judiciary in 2017, a position he will hold until he assumes the presidency.
But even though both men have been critical of the nuclear talks and the deal reached with world powers in 2015, a return to it before Mr Raisi takes office could be preferable.
“We support the negotiations that guarantee our national interests," Mr Raisi said on Monday.
"America should immediately return to the deal and fulfil its obligations under the deal."
Alex Vatanka, director of the Iran programme at the Middle East Institute think tank, said Mr Khamenei could have it both ways if a deal were reached before President Hassan Rouhani leaves office.
"Mr Raisi can claim credit and the regime will sell it as his 'tough' line forced the hands of the western powers," Mr Vatanka told The National.
Sanctions relief is a priority for Mr Khamenei. The Iranian rial has lost more than 80 per cent of its value against the dollar since former president Donald Trump withdrew from the deal in 2018.
Mr Vatanka said returning to the deal in the next two months could inject much-needed cash into the country early in Mr Raisi’s presidency.
Dina Esfandiary, senior adviser on the Middle East at the International Crisis Group think tank, said a deal under Mr Rouhani was an ideal outcome for his successor.
"This means any negative issues can be blamed on the previous administration while Raisi takes credit for the good sides and its implementation," Ms Esfandiary told The National.
On Sunday, US National Security Adviser Jake Sullivan said the ultimate decision on whether or not Tehran would return to the deal rested with Iran’s supreme leader.
“Ultimately, it lies with him and his decisions as to whether he wants to go down the path of diplomacy or face mounting pressure, not just from the United States but from the rest of the international community,” Mr Sullivan said.
But for follow-up talks that would address Iran’s ballistic missile programme and regional behaviour, Mr Raisi’s ascendance complicates matters for the administration of US President Joe Biden.
"Regional issues and missiles are not negotiable," Iran's new president said, while also pre-emptively spurning any meeting with Mr Biden.
A seventh round of talks to return to the nuclear deal is expected to be held in Vienna before the end of the month.