The morning after a group of 30 Royal Marines helped seize the Iranian-flagged Grace 1 in Gibraltar, tired Foreign Office officials did not look exactly jubilant. There was not exactly a sense of foreboding, but diplomats were aware of the wider bilateral consequences for British-Iranian relations.

Now, with the capture of a British-owned oil tanker in the Gulf, some of their worst fears have been realised. The Stena Impero and its crew of more than 20 are now in the hands of the Iranian Revolutionary Guards – and the UK has been shown to be unable to protect British shipping going through the waterways of the strait of Hormuz.

The British insist that they only impounded Grace 1 due its suspected destination – a port in Syria – not due to the fact that the ship was carrying Iranian oil. European Union sanctions against the regime of Bashir al Assad regime were there to be enforced and international law upheld, the British argued. There seemed little doubt, given its circuitous route, that the ship was bound for Syria.

Yet there were some oddities to the British decision. Few previous shipments of oil to Syria have been impounded. The Spanish claim that the British acted under the instruction of the Americans. The Trump administration is trying to freeze all Iranian oil exports as part of its policy of maximum economic sanctions designed to force the Iranians to reopen talks on the nuclear deal signed in 2015.

But Britain opposes that US policy, arguing that it is counterproductive and only likely to strengthen the hands of hardliners in Tehran.

Carl Bildt, the former Swedish prime minister and co-chair of the European council on foreign relations, pinpointed the ambiguities of the British action in Gibraltar: “The legality of the UK seizure of a tanker heading for Syria with oil from Iran intrigues me. One refers to EU sanctions against Syria, but Iran is not a member of the EU. And the EU as a principle doesn’t impose its sanctions on others. That’s what the US does.”

To the Iranian eye, the British action had nothing to do with an EU embargo, and everything to do with an desire to support the US squeeze on Iranian oil exports, the quickest route to bringing the Iranian economy to its knees. Some reports estimate that Iranian exports are down to 200,000 barrels a month.

Britain’s efforts to extricate itself started to emerge at the weekend, when Jeremy Hunt, the foreign secretary, rang his Iranian opposite number, Javad Zarif, and said the ship could be released if there was an undertaking that the ship would no longer travel to Syria.

But trust between Hunt and Zairif is low: Zarif feels let down by Hunt on a range of bilateral issues, including the case of Nazaninin Zaghari-Ratcliffe, the Iranian dual national imprisoned in Tehran.

On a lightning tour of New York this week, Zarif insisted that Grace 1 was not bound for Syria, but to another destination in the Meditternnean that hewould not identify. He refused to give the assurances that Hunt had sought, saying Iran was not going to reveal how it was trying to avoid the US oil embargo.

But the British clearly thought a deal was possible, and pressure was coming from Britain’s European partners to settle the issue. Hunt asked Gibraltar’s chief minister, Fabian Picardo, to come to the UK at short notice to meet not just Theresa May, but Boris Johnson and himself. Talks were also held between Iranian officials and Gibraltar in the foreign office on Thursday.

Picardo continued to insist that the talks had been constructive. Some kind of diplomatic form of words seemed imminent that would satisfy all but the US.

Instead – to the frustration of the Iranians – at a briefing hearing on Friday morning, the Gibraltar court extended the detention of the Grace 1 for 30 days. The 2.1m barrels of oil remain in British hands.

The process had been held against a backdrop of increasing threats from Iran that it would respond in kind to what it saw as “an act of piracy, pure and simple”.

These warnings in some cases were not veiled, but explicit. Although the British were trying to increase the scale of Royal Navy maritime protection to British merchant shipping, the progress was inevitably slow.

In the end, the British-flagged tanker was a sitting duck, and now the consequences are plain for all to see. Not just oil, but crew are now hostage, and diplomats can only ponder in retrospect whether the right judgments were made.