Western powers and Russia have for almost a year worked closely to revive the 2015 Iran nuclear deal, but the war in Ukraine is creating a sense of urgency to conclude talks before cooperation becomes impossible.
The stakes are high. Failure after 10 months of talks could carry the risk of Tehran getting within a short sprint of nuclear weapons and igniting a fresh war in the Middle East.
It could also see more harsh sanctions on Iran by the West and increased rise of world oil prices already strained by the Ukraine conflict.
As Russian troops poured into Ukraine and Western powers responded with tough sanctions, the contrast with the talks in Vienna over the past week has been striking.
Mikhail Ulyanov, the ever-optimistic Russian negotiator, was posting videos and pictures on Twitter showing the ongoing co-ordination with the United States, France, Britain and Germany, even as he toed Moscow's line on Ukraine.
Western officials have repeatedly said that they have always been able to compartmentalize the Iran nuclear dossier because everybody had a common interest to avoid a major non-proliferation crisis.
That could be about to change, however, as pressure mounts on Moscow.
"There's a good chance that a crisis of this magnitude will pollute not only the Iranian file, but many others," said a French presidential official.
"This is one of the many subjects on which the relationship with Russia has very severely, very significantly changed by the behavior of President Vladimir Putin."
Still civil, for now
All parties involved in the talks, which also include China, say progress has been made towards restoring the pact to curb Tehran's nuclear program in exchange for sanctions relief. The 2015 deal, known as the Joint Comprehensive Plan of Action (JCPOA), had fallen apart in 2018 when then President Donald Trump pulled out the United States.
But both Tehran and Washington have said there are still some significant differences to overcome.
Diplomats say Russia has been instrumental in shaping a compromise.
Three diplomats close to the talks emphasized that events in Ukraine had sped up efforts to conclude negotiations this week, fearing it would become more difficult to ignore events elsewhere.
"The longer that talks go on, the greater the chance that the conflict intercedes," said Henry Rome, Iran analyst at consultancy Eurasia.
Diplomats say things have remained civil, but even a cursory look at social media shows that France's main negotiator is repeatedly calling out Russia, while warning Iran that it's playing with fire.
Speaking late on Friday, a senior U.S. State Department official said that, as best Washington could tell, it remained Russia's desire to negotiate a revival of the nuclear deal.
"We're not doing it as a favor to Russia. Russia is not doing it as a favor to us. We're working towards a goal that, on this issue, we appear to have a common interest in: reviving the JCPOA," the official said.
Iran overreaching?
After a brief hiatus in the talks following what appeared to be a final Western offer, Iranian officials have seemingly returned with a tougher stance.
Analysts say the Ukraine crisis may have encouraged Iran to overplay its hand, thinking Washington would be keener to both avoid a second crisis and get Iran's oil back on international markets, where prices have risen above $100 a barrel.
"That's a miscalculation because the U.S. has sufficient bandwidth to deal with these issues simultaneously and it will take at least two months for Iran's oil to hit the markets in case there is a deal," said Ali Vaez, Iran Project Director at International Crisis Group.
"So far tensions over Ukraine have not spilled into the Iran nuclear talks. But it's nearly impossible to segregate them for much longer."
Ulyanov told reporters on Monday that the Ukraine situation has had no impact on the talks and Iranian officials have downplayed it for now.
"These are two separate issues," said a senior Iranian official from Tehran.
"Of course time is running out and with what is happening in Ukraine, Russia might get busy with the crisis and then the West will be responsible for the failure of these talks."
An Iranian security official in Tehran said that even if Russia were to change tack and try to torpedo talks, Iran would prioritize its national interest - the sale of oil and if possible a deal that would enable it.
"Why should we sacrifice our millions of dollars in income because of an alliance with Russia?" the official said.
Should a deal be struck there could be technical implications. Russia is expected to ship excess enriched uranium out of Iran, but Western sanctions could impact that.
"The conflict and sanctions may also introduce implementation risks surrounding Russia's role… but those issues are likely manageable," said Eurasia's Rome.
A first test of whether Ukraine will derail cooperation could come on as early as Wednesday, when some of the protagonists will take a break from Iran to face off at an emergency meeting at the International Atomic Energy Agency (IAEA) to discuss the security and safety of Ukraine's four operational nuclear power plants and various waste facilities, including Chernobyl.
"It has to be this week," said a European diplomat of the urgency of reaching deal. "Because we never know when there might be an escalation in Ukraine and then we're are no longer allies. Who knows, if the (IAEA) Board criticizes Russia on Wednesday, the Russians could say 'To hell with the Iran deal'."