Mr Obama pointedly stopped short of offering a formal defence treaty that some Gulf countries had sought. Instead, he announced more modest measures, including integrating ballistic missile defence systems, beefing up cyber and maritime security, streamlining weapons sales and increasing joint military exercises.

America and five other world powers are seeking to reach a final deal with Iran on curbing its nuclear programme by a June 30 deadline. The Gulf partners agreed in a joint communiqué that a "comprehensive, verifiable" accord with Tehran would be in their security interests.

But Mr Obama did not go as far as saying the Sunni Arab states had committed to backing the outcome of the talks with Iran, their Shi'ite arch-rival.

The Saudi foreign minister made clear, in fact, that his government was withholding judgment for now.

Mr Obama also sought to allay Gulf Arab concerns that the potential lifting of international sanctions on Tehran would embolden it to fuel more sectarian strife in the region.

Flat

No one could pretend that there were any milestone achievements or breakthroughs from the talks.

Indeed, the whole affair looked a little flat. One leader in the Middle East is openly estranged from the White House; another tactfully avoids meetings Mr Obama. A certain Arab king chooses to attend the Royal Windsor Horse Show rather than accept the hospitality of the commander-in-chief of the superpower that guarantees the security of his throne.

Meanwhile, there is one foreign minister from the region who gets to spend more time with the US secretary of state than any other envoy in the world.

The identities of this cast of characters speak volumes about the geopolitical earthquake now shaking the Middle East. In brief: the leaders who cannot bear to speak to Mr Obama are America's oldest allies in the region - and the emissary who passes countless hours with John Kerry is the unlikely figure of Mohammad Javad Zarif, the foreign minister of Iran.

So tangled has American policy become that US diplomats spend days at a time closeted in bilateral talks with their opposite numbers from Tehran - where Washington is routinely condemned as "the Great Satan" - while Benjamin Netanyahu, the Israeli prime minister, is shunned by the White House.

And it was King Salman of Saudi Arabia - a US ally for 70 years - who stayed away from a summit in Camp David on Thursday. As for the Arab leader who chose to meet the thoroughbreds of Windsor rather than Mr Obama, this was King Hamad of Bahrain, whose island domain hosts the US Fifth Fleet. To make matters more complicated, these Arab powers now find themselves in an extraordinary alliance of convenience with Israel - a country they do not recognise and cannot even bring themselves to name, still denouncing it as the "Zionist Entity".

So why the shake-up? And who are the winners and losers?

The first question has a relatively straightforward answer: old alliances are under strain because America and Iran are close to a final agreement that would resolve the confrontation over the latter's nuclear ambitions and remove the biggest obstacle to a new relationship between the two adversaries. Barring a sudden upset, a nuclear deal is likely to be signed in time for a deadline of June 30. We know this because after years of intensive diplomacy - involving all those meetings between Mr Kerry and Mr Zarif - the US and Iran agreed the basis of an accord in Switzerland last month.

In simple terms, Iran will sacrifice two thirds of its centrifuges and almost all of its low-enriched uranium, thereby placing its scientists at least a year away from having the wherewithal for a nuclear bomb. In return, a crippling array of sanctions will be lifted. Mr Obama hails this as a "once in a lifetime opportunity" to make the Middle East safer by stopping Iran from getting a nuclear weapon.

"There is no formula, there is no option, to prevent Iran from getting a nuclear weapon that will be more effective than the diplomatic initiative and framework that we put forward," he said last month.

Privately, US diplomats stress how this outcome would serve the interests of their regional allies more emphatically than anyone else.

But Israel, Saudi Arabia and the other Gulf kingdoms stubbornly fail to be impressed. Partly, they differ with America over the technical merits of the emerging deal. Once Iran has torn out 14,000 of its centrifuges and sold all but a residual amount of low-enriched uranium, the Islamic Republic would indeed be a year away from the ability to "breakout" and make enough fissile material for one nuclear bomb. And, true enough, this would be a big improvement on Iran's current "breakout time" of a few months.

But Israel and the Arab powers believe that America has betrayed them by allowing Iran to have any kind of capacity to enrich uranium at all. The unavoidable truth is that a country possessing thousands of centrifuges and the expertise to keep them spinning will always have a latent ability to produce weapons-grade uranium.

That was why America persuaded the Security Council to pass six United Nations Resolutions demanding that Iran stop enriching uranium altogether - no ifs and no buts.

In theory, those Resolutions remain in force; they have, in reality, been overtaken by the burgeoning diplomacy between Washington and Iran.

Under the probable nuclear deal, Israel and its unlikely strategic partners point out that virtually every step demanded of Iran could be reversed.

In principle, every centrifuge consigned to storage could be returned; every tonne of exported uranium replaced; every redesigned nuclear plant restored to its former state.

Threatened

As a result, Saudi Arabia has threatened to adopt a simple policy, summed up by Prince Turki al-Faisal, a former intelligence chief, as: "Whatever the Iranians have, we will have too."

If Iran is allowed to be a year away from the wherewithal for a nuclear bomb, then the kingdom will place itself in the same position.

The strongest argument for America's policy is that a deal to stop Iran from getting the bomb would prevent a nuclear arms race in the Middle East.

But the possible agreement could trigger a headlong rush not to build a weapon, but to be 12 months away from the ability to do so - a sort of nuclear arms race lite.

At root, however, this collision between America and its friends is not over the clauses and commas of a nuclear agreement, but over how to see Iran itself.

Mr Obama believes the rulers of the Islamic Republic are rational men who can be persuaded to defang their nuclear programme in the interests of ridding their nation of sanctions. Once that particular logjam is broken, Mr Obama thinks that Iran and America can join forces against common threats, starting with the terrorists of Isil.