What will happen to the Iran nuclear deal?
The fate of the nuclear agreement between Iran and the major world powers is in the balance.
The deal, which came into effect in October 2015, (known by the cumbersome title of the Joint Comprehensive Plan of Action (JCPOA), imposed constraints on Tehran's nuclear activities, in return for the lifting of some economic sanctions.
It is easy to forget that the deal came about in an atmosphere where there was growing talk about the possibility of a military strike against Iran.
Israel and many of Washington's Gulf allies were alarmed by Iran's growing assertiveness in the region and - despite Tehran's denials - believed that it had an active nuclear weapons research programme. It also had a sophisticated ballistic missile effort that might one day be used to carry such a weapon.
Iran - they feared - could eventually have been where North Korea is today. And, for the nuclear agreement's advocates, the JCPOA - while not ideal - deferred any crisis. It imposed physical constraints on Iran - the number of centrifuges it could operate and the amount of low-enriched uranium it could have stockpiled.
In return, some sanctions were relaxed or lifted: it got access to international financial markets and could sell its oil. The whole deal was bolstered by an intrusive verification regime operated by the International Atomic Energy Authority (IAEA).
But Donald Trump opposed the deal on the campaign trail and earlier this week he signalled that its fate was still very much in the balance.
In his speech to the United Nations General Assembly, he described it as "one of the worst and most one-sided transactions the United States has ever entered into. Frankly," he went on, "that deal is an embarrassment to the United States, and I don't think you've heard the last of it, believe me."
The next few weeks will be critical. President Trump is due to certify that the deal is still in US interests in mid-October.
If he decides not to do so, then the issue is automatically referred to the US Congress, which has 60 days to decide whether to resume the sanctions that were in effect at the time of the adoption of the original agreement.
Doing so requires only a majority vote. If Congress passed such a bill, it would go back to the president for his signature. Once signed, the US would be turning its back on the JCPOA, effectively sealing its fate.
- Iran nuclear deal: US 'sunset clause' concern remains - Tillerson
- Iran nuclear deal: Key details
- Why has Trump been so harsh on Iran?
- Iran's leader Hassan Rouhani slams Donald Trump in UN speech
But there is a slight problem for President Trump. All parties to the agreement (including the US Secretary of State Rex Tillerson) have just re-affirmed that the JCPOA is being implemented properly.
The EU's foreign policy chief Federica Mogherini chaired a meeting of the foreign ministers of the countries that had promoted the agreement - China, Russia, the US, France, Germany Britain and Iran - on the sidelines of the UN General Assembly. And all accepted that its terms are being honoured fully and there are no violations.
Indeed, some US experts believe that, since President Trump's election victory, Iran has been bending over backwards to honour the letter of the agreement, so as not to give the Trump administration any excuse to abandon the deal.
So what is President Trump's concern? Well it is two-fold: partly opposition to the agreement per se but also to the role Iran is playing in the wider Middle East region. His difficulty is that the JCPOA is quite specific.
As Federica Mogherini noted: "The scope of the nuclear deal is related to the nuclear program of Iran. There are other issues that are out of the scope of the agreement."
And, with so many other problems in the world, she concluded that the international community "cannot afford to dismantle an agreement that is working and delivering".
President Trump is clearly not happy with this. There are suggestions that his administration is exploring the possibility of re-drafting the deal or seeking a follow-up agreement that would extend its timescale and tackle the related problem of Iran's ballistic missile programme.
Re-drafting, though, is probably a non-starter. A follow-up deal might be more feasible but clearly Iran would want something in return if - and it is a big if - it was willing to countenance the idea at all.
But Washington's most pressing problem with Iran is its regional behaviour. The Obama administration struggled with the same issues. Part of its answer was to back the nuclear accord, at least removing that issue from the table for the immediate future.
The paradox here is that, to an extent, the US is the author of its own misfortunes. Having knocked out the Iraqi regime of Saddam Hussein, it amplified Tehran's role as a major strategic player in the region and subsequent events have only enhanced its position and influence.
The flashpoints between Washington and Tehran are numerous:
Tehran is a close ally of the Shia-dominated government in Baghdad and an important power-broker in the country. In the past Iran gave considerable support to Shia groups opposed to the US occupation.
Indeed, many of President Trump's closest advisors are former military men who hold Tehran responsible for the loss of many US and allied lives.
Here Iran is both "fireman and arsonist" in the words of one notable US Iran-watcher, Karim Sadjadpour. Iran is one of the few close allies of the Syrian regime.
Its own military advisers and pro-Iranian militias have been active on Syria's battlefronts. It shares responsibility with the Syrian regime for the catastrophe that has befallen the country's civilian population.
On the other hand, Iran is a sworn enemy of the so-called Islamic State. But as the latter loses more and more ground, so the likelihood of friction between pro-Iranian and US-backed groups is increasing.
Iran's growing influence in Syria (along with that of its Lebanese militia ally, Hezbollah) is causing unease in Israel, which now sees a lengthy frontline developing, extending from its border with Lebanon on the Mediterranean, all the way to the point where Syria, Jordan and Israel meet.
Any future war involving Israel and Hezbollah would almost inevitably involve Iran. Tehran is also reported to be setting up arms factories in both Lebanon and Syria to supply its regional allies. And there is unease in Israel that Moscow, Syria's other ally, will not be able to constrain Iran's influence, even if it wanted to.
Iran has given some support to Yemen's Houthi rebels, who are engaged in a conflict against Saudi-backed local forces.
For the Saudis this is very much the sharp end of Iran's growing regional role, but it probably has a lower priority in Tehran. The Iranians are probably just pleased that the Saudis have their coats caught in the mangle of an open-ended military adventure which is delivering little gain.
- The Gulf
In the waters of the Gulf, US and Iranian naval forces confront each other on an almost daily basis. Tensions are frequently high with small vessels belonging to Iran's Revolutionary Guard Force goading the Americans and the possibility of a misunderstanding leading to a wider crisis is real.
All of these potential flashpoints underscore the problem that even if President Trump chooses to honour the nuclear agreement, it could easily fall victim to a broader crisis prompted by wider regional tensions.
Some would say that this is a point that argues in favour of the JCPOA's retention. If Iran was free of the nuclear constraints and facing greater US hostility might it not seek to pursue the path followed by the North Korean regime, they ask? How might that make the situation any better?
So how much threat is the nuclear deal really under? The showman in President Trump hints that his mind is already made up.
But he has committed to many things - a move of the US embassy from Tel Aviv to Jerusalem for example - and once in office has failed to follow through. Might he reluctantly stick with the JCPOA after all?
Well, walking away from it is not going to be easy just as long as all the other parties believe it is working.
It could prompt a huge diplomatic row, not just with China and Russia, but also with three of Washington's closest western European allies. He would have a hard time re-forming the broad coalition needed to back renewed economic sanctions. It is hard to see this as a winning formula.
Part of the Trump administration's problem is its absence of a wider, more coherent approach to the region as a whole. Iran is a growing problem for the US and its allies and will remain so. Perhaps - as hinted at by the EU's foreign policy chief - there could be separate talks with Iran on its place in the region.
Even if Mr Trump reluctantly decides to back the nuclear deal there's no danger that his administration is going to go soft on Iran. Too many of its senior figures have seen Iran's activities in the region first-hand.
But it is by no means clear that abandoning the nuclear agreement will serve anyone's interests, and in private that is what some of them at least, may be telling the White House.
And what of the Iranian voice in all of this? They have made clear that they will not walk away from the deal.
Though they feel that some of the economic benefits have been less than expected or are being delivered more slowly, there is no pressing reason for Tehran to abandon the agreement. It can sit on the sidelines and watch the Trump administration struggling with the issue.
Over time might they be tempted to test the international community's resolve? Might they seek to restart banned activities?
If the agreement is to last its full term then it will depend upon vigilance from the IAEA inspectors, but they in turn will depend upon good intelligence that can only come from countries like the US.
The JCPOA may well be tested in the future. But for now, some of its supporters say, why add another problem to the already crowded diplomatic agenda?