Iran and six world powers agreed Thursday on the outline of a potentially historic deal to curtail its nuclear programme in return for the lifting of economic sanctions on the Islamic republic.
Even while struggling under sanctions and in diplomatic isolation, Iran's influence has been on the rise and it is deeply involved across the region.
On top of its long-standing ties to the Syrian regime and Hezbollah militants in Lebanon, it has been leading the fight against the Islamic State group in Iraq and is the chief backer of the surging Huthi rebellion in Yemen.
When negotiations over Iran's nuclear programme began in 2013, there were hopes a deal could pave the way for greater cooperation on these security issues, but some analysts say the moment may have passed.
"Things have changed so much in the last few months, even weeks. The nuclear issue used to be the paramount issue in the region, but the security debate has moved on," said David Hartwell, managing director of Middle East Insider magazine based in London.
Some still hope the agreement will encourage Iran and its Middle Eastern rivals to sit down together.
"Up to now Iran intervenes without being asked in regional issues and that leads to war. An agreement means Iran must start playing a more diplomatic game," said Bernard Hourcade, of the National Centre for Scientific Research in Paris.
Hasni Abidi, director of the Geneva-based Study and Research Centre for the Arab and Mediterranean World, said one possible result of sanctions being dropped is that Iran will become more interventionist using weapons bought with the funds released from unfrozen accounts.
"On the other hand, will the international recognition make it less aggressive, will it make Iran drop its pressure (on its regional rivals)?," Abidi said.
UN Secretary-General Ban Ki-moon said Thursday the nuclear deal "will contribute to peace and stability in the region".
But the last week has seen Iran's chief rival Saudi Arabia set up a 10-country Arab military coalition to check the Iran-backed Huthis in Yemen, launching air strikes across the country.
Many fear the region is on the verge of full-blown war rather than reconciliation, with the leading powers unlikely to cooperate even on areas of common interest.
"There is precious little evidence that the Saudis or anyone else is happy with Iran's involvement in the fight against (the Islamic State group), or willing to cooperate with Iran on anything at all," said Hartwell.
- 'Misunderstandings & missed opportunities' -
Any agreement still faces major obstacles to implementation. The opposition Republicans in Washington, who control Congress and see Iran as a major threat that cannot be trusted, must yet approve the lifting of sanctions.
Signup to our newsletter and follow us on Facebook and Twitter!
At the heart of the debate is an attempt to understand Iran's motives and intentions.
Saudi Arabia and Israel -- supported by the hawks in Washington -- see an aggressive rising power seeking to establish control across large swathes of the Middle East.
Freed from the financial constraints of sanctions, Iran could step up that aggression and trigger a nuclear arms race in the region.
"Whatever comes out of these talks, we will want the same," former Saudi intelligence chief, Prince Turki al-Faisal, told the BBC this month.
Its late king, Abdullah, bluntly warned a US ambassador in 2009: "If they get nuclear weapons, we will get nuclear weapons."
But others see Iran as acting from a position of weakness.
"Iran doesn't sit around plotting how to take over the Middle East, but they do spend a lot of time thinking about how to stop others from doing so," said Flynt Leverett, a Middle East expert at Penn State University in the US.
Encircled by US allies, with a weaker military than smaller neighbours and left out of security partnerships, Tehran has used proxies and interventions to protect its position, said Ali Vaez of the International Crisis Group.
It is possible a nuclear deal could encourage Iran to feel less threatened and more willing to work through diplomatic channels, but matters are rarely so simple in a region where no conflict has ended peacefully in decades.
"Iran's relations with its neighbours are replete with misunderstandings and missed opportunities," said Vaez.
- Win for Russia, China -
If sanctions are lifted, the big winners may be Russia and China.
They have been involved in the nuclear negotiations, and do not face the sort of domestic opposition that will make it difficult for the United States to fully embrace Iran.
"Beijing and Moscow are taking steps to deepen their already considerable economic and strategic involvement in Iran," said Leverett, adding that both Chinese President Xi Jinping and Russian President Vladimir Putin were due to visit Tehran in the coming weeks.
"This should be a springboard for a 'Nixon to China' moment -- a great victory for American diplomacy -- but the benefits will all go to China and Russia," he said.
"The Obama administration will have snatched defeat from the jaws of victory."