John Bolton, White House national security adviser and notorious Iraq-era hawk, is a man on a mission. Given broad latitude over policy by Donald Trump, he is widely held to be driving the US confrontation with Iran. And in his passionate bid to tame Tehran, Bolton cares little who gets hurt – even if collateral damage includes a close ally such as Britain.

So when Bolton heard British Royal Marines had seized an Iranian oil tanker off Gibraltar on America’s Independence Day, his joy was unconfined. “Excellent news: UK has detained the supertanker Grace I laden with Iranian oil bound for Syria in violation of EU sanctions,” he exulted on Twitter.

Bolton’s delighted reaction suggested the seizure was a surprise. But accumulating evidence suggests the opposite is true, and that Bolton’s national security team was directly involved in manufacturing the Gibraltar incident. The suspicion is that Conservative politicians, distracted by picking a new prime minister, jockeying for power, and preoccupied with Brexit, stumbled into an American trap.

In short, it seems, Britain was set up.

The consequences of the Gibraltar affair are only now becoming clear. The seizure of Grace I led directly to Friday’s capture by Iran’s Revolutionary Guards of a British tanker, the Stena Impero, in the Strait of Hormuz. Although it has not made an explicit link, Iran had previously vowed to retaliate for Britain’s Gibraltar “piracy”. Now it has its revenge.

As a result, Britain has been plunged into the middle of an international crisis it is ill-prepared to deal with. The timing could hardly be worse. An untested prime minister, presumably Boris Johnson, will enter Downing Street this week. Britain is on the brink of a disorderly exit from the EU, alienating its closest European partners. And its relationship with Trump’s America is uniquely strained.

Much of this angst could have been avoided. Britain opposed Trump’s decision to quit the 2015 nuclear deal with Iran, the trigger for today’s crisis. It has watched with alarm as the Trump-Bolton policy of “maximum pressure”, involving punitive sanctions and an oil embargo, has radicalised the most moderate Iranians.

Yet even as Britain backed EU attempts to rescue the nuclear deal, Theresa May and Jeremy Hunt, foreign secretary, tried to have it both ways – to keep Trump sweet. They publicly supported Washington’s complaints about Iran’s “destabilising” regional activities and missile programme, and berated Iran when it bypassed agreed nuclear curbs.

Crucially, the government failed to significantly beef up protection for British-flagged vessels transiting the Gulf after attacks in May and June. This was partly because a depleted Royal Navy lacks capacity to mount adequate patrols. But it was also because officials feared that by raising its military profile, Britain could be sucked into armed conflict with Iran.

For Bolton, however, drawing Britain unambiguously in on America’s side was a desirable outcome. So when US spy satellites, tasked with helping block Iranian oil exports in line with Trump’s global embargo, began to track Grace I on its way, allegedly, to Syria, Bolton saw an opportunity.

The Spanish newspaper, El Pais, citing official sources, takes up the story: “The Grace 1, which flies a Panamanian flag, had been under surveillance by US satellites since April, when it was anchored off Iran. The supertanker, full to the brim with crude oil, was too big for the Suez Canal, and so it sailed around the Cape of Good Hope before heading for the Mediterranean.

“According to the US intelligence services, it was headed for the Syrian oil refinery of Banias. Washington advised Madrid of the arrival of the supertanker 48 hours ahead of time, and the Spanish navy followed its passage through the Strait of Gibraltar. It was expected to cross via international waters, as many Iranian vessels do without being stopped.”

Although Spanish officials, speaking after the event, said they would have intercepted the ship “if we had had the information and the opportunity”, Spain took no action at the time. But Bolton, in any case, was not relying on Madrid. The US had already tipped off Britain. On 4 July, after Grace I entered British-Gibraltar territorial waters, the fateful order was issued in London – it is not known by whom – and 30 marines stormed aboard.

Iran’s reaction was immediate and furious. It claimed Britain had acted illegally because the EU embargo on oil supplies to Syria, which Hunt claimed to be upholding, applied only to EU states and not to third countries such as Iran. In any case, Tehran said, the ship’s destination was not Syria.

Iran’s outrage was shared, to a lesser degree, by Josep Borrell, Spain’s socialist foreign minister. Borrell resented the British incursion into Gibraltar’s territorial waters, which Madrid does not recognise. He also appears to have been annoyed that Spain was drawn in – in Tehran, the Spanish ambassador had been summonsed by the foreign ministry to explain Madrid’s role. His reaction was to distance Spain from the affair. The Iranian tanker had been seized “following a request from the United States to the United Kingdom,” he said. And even though Britain was supposedly upholding EU regulations, the External Action Service, the EU’s foreign policy arm, has remained silent throughout.

Iran’s retaliation in snatching the Stena Impero has further exposed Britain’s diplomatic isolation and its military and economic vulnerability. The government has advised British ships to avoid the Strait of Hormuz, an admission it cannot protect them. But between 15 and 30 British-flagged tankers transit the strait each day. If trade is halted, the impact on energy prices may be severe.

Hunt’s appeal for international support for Britain has so far fallen on deaf ears, France and Germany excepted. China, Japan and other countries that rely on oil from the Gulf show no sign of helping. The US plan for a multinational coalition to protect Gulf shipping has few takers. Meanwhile, Trump’s promise to back Britain has scant practical value – and carries inherent dangers.

The Bolton gambit succeeded. Despite its misgivings, Britain has been co-opted on to the front line of Washington’s confrontation with Iran. The process of polarisation, on both sides, is accelerating. The nuclear deal is closer to total collapse. And by threatening Iran with “serious consequences”, without knowing what that may entail, Britain blindly dances to the beat of Bolton’s war drums.