It was like something out of a movie. To shouts of Allahu Akbar!, masked soldiers drop down ropes from a military helicopter on to a British oil tanker while Iranian navy speedboats surround the vessel. By radio, a voice warns the ship’s captain in English: “If you obey you will be safe”. There is no doubt that the Friday seizure by Iranian Revolutionary Guards of a British-flagged tanker, the Stena Impero, was in part a piece of theatre intended to appease domestic clamour for Tehran to assert itself. It came in response to the UK military’s 4 July detention of an Iranian tanker, the Grace 1, in Gibraltar, allegedly for shipping oil to Syria in breach of EU sanctions. But the tit-for-tat response should also be evaluated as part of the Iranian attempt to push back against Donald Trump’s unilateral abandonment of the Joint Comprehensive Plan of Action, the 2015 nuclear deal with Iran, and his reimposition of economic sanctions.

It is not clear if this strategy will do much to convince an exasperated Iranian public suffering under sanctions. It is also fraught with risks of escalation, threatening to further complicate UK-Iran bilateral relations and endanger wider European efforts to save the JCPOA, the international deal that committed Iran to strict curbs on its nuclear programme, in exchange for the lifting of sanctions. The risks are, at the moment, seen by Tehran as a necessary gamble to improve its international leverage if dipomatic negotiations resume. Two weeks of fruitless mediation efforts to release the Grace 1 prompted Iran’s supreme leader Ali Khamenei to state: “The Islamic Republic and its committed forces will not leave this evil without a response.” It seems the Stena Impero is a pawn in a bigger game.

Iran blames the Trump administration for influencing and coordinating the seizure of its tanker. Iran has a point: this crisis is inextricably linked to the wider effort by US hardliners to pressure Iran. Having unilaterally withdrawn from the JCPOA and reimposed sanctions, Washington’s actions have undoubtedly lead to the escalatory ripple effects now playing out in the Strait of Hormuz.

The Stena Impero is a bargaining chip for the release of the Grace 1

Over the past year the countries known as the E3 – France, Germany and the UK – have tried in vain to save the JCPOA. Faced with the loss of the promised material benefits of signing up to the deal, Iran has begun to marginally breach its nuclear commitments by increasing its levels of enriched uranium.

Under siege from US sanctions and receiving limited tangible benefits from Europe, Tehran has chosen to up the ante and make the international community feel some of its pain. The Stena Impero is a bargaining chip for the release of the Grace 1. Other Iranian provocations – deliberate breaches of the JCPOA, the downing of a US drone, attacks on other tankers in the Gulf and the arrests of dual nationals – should be seen in the same context.Iranian policymakers are also taking a leaf from the perceived success of a 2005 confrontation that resulted in the acceleration of Iran’s nuclear programme, believed to have produced greater international concessions. Caught between US bullying and the frustration of Iranian nuclear transgressions, Europe has tried to pursue an independent approach. But if Iran continues to escalate it could provoke a greater European-US alignment than would be useful for itself. Indeed, the E3 have jointly condemned Iran’s actions and have called for the quick release of the ship.

While Jeremy Hunt has warned Iran of “serious consequences”, it is important for the British response to be calibrated. Above all, the UK should avoid the temptation to align completely with Washington on Iran. Talk of sanctions and asset freezes will only put the nuclear deal and European efforts at further risk.

Rather than conflating the ships and the nuclear crisis, a direct UK-Iran bilateral negotiation on the tankers could provide both sides with a face-saving outcome. It could in turn allow the new British prime minister to take a bigger role in JCPOA mediation efforts. The UK could position itself as a bridge between the EU and US, and in the process boost its post-Brexit relevance.

• Sanam Vakil is a senior research fellow in the Middle East and North Africa programme at Chatham House