Weary negotiators appear increasingly unlikely to revive a 2015 nuclear deal between Iran and world powers before the Islamic Republic's June presidential election, but an extension of talks could reap political gains at home for the supreme leader.
The man who ultimately matters in the Iranian nuclear question, Supreme Leader Ayatollah Ali Khamenei, would like the negotiations between Tehran and six global powers in Vienna to end Iran's economic isolation, officials and insiders say, but at a favourable time.
At stake in Iran is which political faction within the country's complex power structure will take credit for removing US sanctions that were re-imposed after former US president Donald Trump exited the 2015 pact three years ago.
Prolonging the talks to bring back Tehran and Washington into full compliance with the accord would mean that the process of peeling back layers of US sanctions would start after the June 18 vote, when a hardline ally of Khamenei is expected to replace the current pragmatist president, Hassan Rouhani.
Although the vote will have scant impact on Iran's foreign or nuclear policies, in which Khamenei already has the final say, an end to Iran's economic isolation when a hardline president is in office could strengthen Khamenei's hand at home.
"Ultimately, Iran's leader wants the US sanctions to be lifted. But he would not mind if the talks take a little longer," said a senior Iranian government official.
"If the deal is saved at the last moment possible, then the next president will benefit from the lifting of sanctions to improve the economy. This is the most favourable timing for him."
Seen by analysts as a move intended to achieve just such a delay, Iran said on Sunday the UN nuclear watchdog's access to images of nuclear sites would cease as a three-month monitoring accord between Tehran and the agency had expired.
Iran on Monday extended the monitoring deal for a month, avoiding a possible collapse of the Vienna talks. [nL2N2NB0JT}
A regional diplomat, briefed by Western officials involved in the nuclear talks, said "an agreement that would clarify the obligations of Tehran and Washington to move forward" will be announced in Vienna this week.
The idea that Khamenei would desire a delay in ending sanctions may seem at odds with his efforts to halt the damage being done to Iran's economy by what he sees as Iran's "number one enemy", the United States.
But for Khamenei, the importance of rescuing the economy has had to be balanced by the necessity of preserving his own power from any perceived threat, officials and analysts said.
Iran's clerical rulers fear a re-eruption of unrest among middle and lower-income Iranians - whose periodic protests in recent years served as a reminder of how vulnerable the establishment could be to popular anger over economic hardship.
Public dissatisfaction has also been simmering in Iran on the Islamic Republic's stepped-up pressure on dissenting voices and restrictions on political freedoms and social life.
Activists have called for a boycott of the election and the hashtag #NoToIslamicRepublic has been widely tweeted by Iranians inside and outside the country in the past weeks.
Such dissent challenges Khamenei's immense authority. He controls the judiciary, the security forces, public broadcasters and foundations that own much of the economy.
"Hardliners have a majority in Iran's parliament ... The judiciary chief is appointed by Khamenei and if, as expected, a hardliner wins the election, then we can say hardline allies of the supreme leader are in full control of the country," said a former senior official, who is close to Iran's decision-making centre.
"If the sanctions are lifted after the election, then hardliners close to the leader will be seen as heroes in the country."
A senior European official said speed was of the essence with Iran's election looming.
"The urgency is there. We need an agreement before the election ... We have to take this opportunity now and not wait several months. I'm not sure the Americans will offer this branch twice," said the European official.
Since Trump ditched the deal, asserting it was too lenient on Iran, Tehran has been rebuilding stockpiles of low-enriched uranium, enriching it to higher levels of fissile purity and installing advanced centrifuges to speed up production.
President Joe Biden has said Washington will return to the pact if Tehran first resumes compliance with its strict limits on uranium enrichment, a potential pathway to nuclear bombs.
If there is an issue at the core of Iran's election, it is whether the next president can jumpstart the economy and ease the deep financial pressures facing the majority of Iranians.
A virulent combination of US economic sanctions and poor management have pushed over half of Iran's 83 million population under the poverty line, resulting in a daily struggle to cope with spiralling prices and high unemployment.
Official opinion polls, including one conducted in May by Iran's state-run television, suggest turnout in the vote could be as low as 30%, significantly lower than in past elections.
Another Iranian official, close to hardliners, said the risk of fresh unrest would ease if sanctions were lifted after the vote, as Iranians would then have hope of better times to come.
"After the election, improving the economy will be essential to improve our people's living standards," he said. "Any unrest over the economic hardship can seriously hurt the Islamic Republic."