A chain of events has been triggered that is increasingly exposing the UK diplomatically and militarily in the Gulf.

The UK has put British shipping on maximum alert in the Gulf, just as the foreign secretary, Jeremy Hunt, is forced to admit that – due to successive defence cuts – the UK does not have the resources to defend British vessels.

Simultaneously, the UK is battling diplomatically to keep the nuclear deal with Iran alive – a path the US rejects.

British officials insist there is no connection between freedom of navigation and the preservation of the Joint Comprehensive Plan of Action, as the deal is known. But the two issues are inextricably linked.

British officials weighed the implications for the nuclear deal before British marines seized Grace 1, an Iranian-owned oil tanker, off the strait of Gibraltar following a request from the US.

On one side of the ledger, the UK prides itself on upholding international law, including sanctions. The cargo was in breach of EU law because it was taking oil to Syria.

But on the other side of the ledger, capturing Grace 1 would have little practical impact on Syria since it can still import oil from Russia. Moreover, if the UK went ahead with the seizure, it would be locked into a long legal battle, while British shipping in the Gulf would be vulnerable to Iranian reprisals and damage.

The UK did not need another row with Iran just as the talks between Tehran, and the UK, France and Germany to rescue the nuclear deal reached their most sensitive stage.

Timeline Recent tensions in the Gulf Show The UAE says four commercial ships off its eastern coast 'were subjected to sabotage operations'. Yemen's Houthi rebels launch a drone attack on Saudi Arabia, striking a major oil pipeline and taking it out of service. Saudi Arabia subsequently blames Iran for the attack. A rocket lands near the US embassy in the Iraqi capital, Baghdad, without harming anyone. It's not clear who is behind the attack, but after the initial reports, Donald Trump tweets: 'If Iran wants to fight, that will be the official end of Iran. Never threaten the United States again!' Saudi Arabia says 26 people were wounded in an attack by Yemen's Houthi rebels on an airport in the kingdom's south-western town of Abha. Two oil tankers near the strategic strait of Hormuz were reportedly attacked in an assault that left one ablaze and adrift. 44 sailors were evacuated from both vessels and the US navy assisted. Iran’s Revolutionary Guards say they have shot down what they called a US 'spy' drone they claim was flying in in the country’s airspace. The US military confirm one of its drones has been taken down, but say it was in international airspace. Donald Trump reportedly gives approval for the US military to launch strikes on Iran in retaliation for the loss of the drone, before pulling back at the last minute. The Iranian and US presidents trade insults, with Hassan Rouhani suggesting that Donald Trump suffered from a “mental disorder” and Trump once more threatening Iran with “obliteration”. Iran summons UK ambassador over an incident off Gibraltar as Royal Marines seize a tanker, Grace 1, the UK suspects of carrying oil to Syria. The International Atomic Energy Agency, the body tasked with verifying Iranian compliance with the terms of the nuclear deal, verifies that Tehran has breached the agreed 3.67% limit for enriched uranium. The UK government says three Iranian boats were warned off by the frigate HMS Montrose after Iranian boats 'attempted to impede' a British oil tanker in strait of Hormuz. Tehran denies involvement. In a major escalation, Iran seizes the Stena Impero, a British-flagged tanker, off its coast. Iranian officials later make it clear that the capture was in retaliation for the capture of the Iranian supertanker Grace 1 earlier in July. Despite US attempts in the courts to prevent it, Gibraltar says it will free oil tanker at centre of the Iran row. Iran gives assurances the oil is not destined for Syria, where selling it would breach international sanctions against Britain accuses Iran of breaching those assurances after Tehran acknowledged the oil had been sold, and the reflagged tanker Adrian Darya 1, previously known as Grace 1, had reached its final destination after the ship was photographed off the coast of Syria.

Tehran had for weeks been gradually reducing its commitments under the deal, in a calibrated effort to force Europe to do more to challenge US policy.

Lord Howell, a former Conservative cabinet minister and chairman of the Lords international relations committee, asked his government on Thursday whether it “was such a good idea to raid the Iranian oil tanker in Gibraltar in the first place”. He said: “Obviously we want to stop oil getting to President Assad, although probably he can get all the oil he wants from Russia. Are we not supposed to be on the same side as the Iranians on the question of nuclear proliferation and control? Can we have a firm assurance that we did this not just at the say-so of the US?”

Lady Goldie, for the government, insisted the request to intercept the ship came from the government of Gibraltar, but Foreign Office officials in the past have indicated the biggest factor in play was pressure from the US.

Speaking on the BBC, Nathalie Tocci, the special adviser to the EU foreign policy chief, Federica Mogherini, put the UK decision in a wider political context. “The UK is feeling its own fragility and a fear of isolation as it tries to cut off its membership from the EU. There’s a line connecting the Iran story and the UK ambassador to the US.”

Either way, once Grace 1 had been seized, UK shipping in the Gulf was in Iranian crosshairs. By the weekend, the British government was privately advising British flagged vessels not to carry oil through the Gulf, leading to an abrupt about-turn of a BP tanker, British Heritage, heading to collect oil in Basra.

By Tuesday night the British government was lifting the code alert to level 3, the highest possible, and on Wednesday the giant British Heritage was interrupted by Iranian ships.

Curiously, media briefing about British Heritage, and the intervention by HMS Montrose, which warded off the Iranian boats by aiming its guns at them, came originally from the US, and not the Ministry of Defence.

The episode has highlighted the vulnerability of British shipping. There are not that many large British oil or gas tankers in the region – 50 or so out of 800 – but they are now targets, and not all of them can be protected.

At the same time the British appear to be sceptical of US plans to form a multinational maritime protection force in the Gulf. The UK is awaiting the details of the US proposals, but at a briefing on Tuesday, Gen Joseph Dunford, chairman of the US military’s joint chiefs of staff, said he wanted to ensure freedom of navigation.

The US would provide “command and control” ships, leading surveillance efforts, he said. However, the aim would be for other countries to offer boats to establish patrols nearby, and escort commercial ships carrying their flags through the area.

The UK has not rejected this plan, but seems to be nervous that the US, with a different political agenda towards Iran, should direct ships, including those flagged by countries that are not seeking a showdown with Tehran.

The Foreign Office takes the view that a confrontation with Iran would be counter-productive, and is interested in developing a regional alliance to de-escalate the conflict, an initiative that has also attracted the United Arab Emirates.

As the drama takes place on the high seas, the EU says it is making some progress on its controversial barter-type system to trade with Iran and get around US sanctions, part of its efforts to keep the nuclear deal alive.

The EU foreign policy secretary general, Helga Schmid, said on Thursday that beyond the 10 EU nations that were already part of the system, “we now have seven more member states that have announced they will either join the shareholders or use Instex”, she said, referring to the barter system.

Schmid added that “from consultations I had last week, I can share with you that more, also non-EU member states, will join”.

The EU still believes that the Iran deal can be saved, but the US wants it to fail.

The risk is that, after failing to prise the UK away from its political support for the Iran nuclear deal, the US will gently prod its closest ally towards a naval bust-up in the Gulf that ends with the UK facing no option but to quit the deal and ally with the US.