Iran has indicated it wants to de-escalate the British-Iranian crisis, hinting at swapping two captured tankers.

“We do not seek the continuation of tension with some European countries,” Iran’s president, Hassan Rouhani, said on Wednesday during a weekly cabinet meeting. “If Britain steps away from the wrong actions in Gibraltar, they will receive an appropriate response from Iran.”

He was speaking after a two-day visit by Iraq’s prime minister, Adil Abdul-Mahdi, who had revealed he went to Tehran this week partly at the request of the UK defence secretary, Penny Mordaunt, to negotiate the release of the captured British-flagged ship Stena Impero seized by Iranian forces in the strait of Hormuz last Friday.

The Iraqi prime minister revealed that on Monday “there was a phone call with the British defence minister to discuss bilateral ties, the regional crisis, and efforts of de-escalation and decreasing tensions in the region, and also the existing crisis covering the confiscated ships”. Iraq is a strong opponent of US sanctions against Iran.

Iran said it had seized the Stena Impero after the UK seized an Iranian ship, Grace 1, off Gibraltar. The Foreign Office has claimed continuing negotiations with Iranian officials in London about the terms of the ship’s release were interrupted by the surprise Iranian decision to capture the Stena Impero. Britain has offered to release Grace 1 as long as Iran provides guarantees that the ship will not continue with a plan to unload Iran’s oil at the Syrian port of Baniyas refinery. The UK has said any export sales to the refinery are prohibited under EU law.

Iran said the oil was not destined for Syria but will not name its actual destination, saying that would expose the customer to US sanctions.

The new US defence secretary, Mark Esper, said on Wednesday, than Washington was also seeking to defuse the standoff in the Gulf.

“We’re trying to deescalate and at the same time message them very clearly that without preconditions, any time, any place, we are willing to meet with them and talk about how we get back into a negotiation,” Esper told reporters.

He added that European plans to coordinate naval escorts for oil tankers transiting the strait of Hormuz were “complementary” to the US proposal, dubbed Operational Sentinel. “The Brits are escorting their ships, and we will escort our ships to the degree the risk demands it and I assume other countries will escort their ships.”

Esper said US escort for tankers could be done party from the air. “In some cases that may be strictly an overhead capability. It may mean there is a US naval warship within proximity to deter it […] I don’t necessarily mean that’s every US flagged ship going through the strait has a destroyer right behind it.”

Play Video 0:39 Iran releases footage of seized British-flagged oil tanker - video

A study suggested the seizure was legal under Gibraltarian law, but only as a result of regulations passed on 3 July – the day before the seizure – which gave the first minister the power to designate a ship for seizure if it is in breach of EU regulations on sanctions against Syria.

The study by Michelle Linderman, a partner at Crowell & Moring’s international trade group, said the sanctions applied only if the ship was in Gibraltarian waters at the time of the seizure.

Rouhani’s possible olive branch on a ship swap came as part of a broader set of remarks containing Iran’s familiar mixture of threats and assertions of its willingness to negotiate.

Boris Johnson can use his affinity with Trump to calm the crisis over Iran | Suzanne Maloney Read more

But in a sign that the crisis could potentially escalate quickly given the many layers of Iranian politics, Iranian officials quoted by Al Jazeera claimed the United Arab Emirates was being turned into operations headquarters for the US after an attempt at regional mediation failed.

Hossein Dehqan, an adviser to the Iranian supreme leader, Ali Khamenei, claimed all US military bases and pieces in the region would be directly targeted if Washington took the decision to go to war, stressing that any American war against his country meant that the US would face Iran and its allies throughout the region.

He said any change in the situation of the strait of Hormuz would increase tension and could open the door to a dangerous confrontation.

In his cabinet remarks, Rouhani vowed to take a third step away from the Iran nuclear deal unless progress was made in its demands for greater European efforts to lift the economic pressure placed on Tehran by the US. “We will surely take the third step,” he said. Iran has already breached permitted uranium enrichment levels and stocks in minor but clear violations of the agreement signed in 2015, but from which the US has unilaterally withdrawn.

Q&A What is the Iran nuclear deal? Show Hide In July 2015, Iran and a six-nation negotiating group reached a landmark agreement known as the Joint Comprehensive Plan of Action that ended a 12-year deadlock over Tehran’s nuclear programme. The deal, struck in Vienna after nearly two years of intensive talks, limited the Iranian programme, to reassure the rest of the world that it cannot develop nuclear weapons, in return for sanctions relief.

At its core, the JCPOA is a straightforward bargain: Iran’s acceptance of strict limits on its nuclear programme in return for an escape from the sanctions that grew up around its economy over a decade prior to the accord. Under the deal, Iran unplugged two-thirds of its centrifuges, shipped out 98% of its enriched uranium and filled its plutonium production reactor with concrete. Tehran also accepted extensive monitoring by the International Atomic Energy Agency (IAEA), which has verified 10 times since the agreement, and as recently as February, that Tehran has complied with its terms. In return, all nuclear-related sanctions were lifted in January 2016, reconnecting Iran to global markets. The six major powers involved in the nuclear talks with Iran were in a group known as the P5+1: the UN security council’s five permanent members – China, France, Russia, the UK and the US – and Germany. The nuclear deal is also enshrined in a UN security council resolution that incorporated it into international law. The 15 members of the council at the time unanimously endorsed the agreement. On 8 May 2018, US president Donald Trump pulled his country out of the deal. Iran announced its partial withdrawal from the nuclear deal a year later. Saeed Kamali Dehghan, Iran correspondent

“Europe must expedite its attempts to meet Iran’s legitimate [economic] interests [under the deal] and bring about truce in the US economic warfare,” Rouhani said.

He also warned against any British-led attempt to form an international coalition to protect shipping in the Gulf, saying the Iranian Revolutionary Guards were responsible for security in the strait of Hormuz.

The response comes after Italy, Denmark, the Netherlands and France on Tuesday backed the UK’s proposal for a European naval force to protect shipping in the Gulf, which would be distinct from any US maritime security operation.

Germany said it was still studying the plans. “We are taking part intensively in these talks, but the conceptional deliberations are just beginning. It is too early today to talk about the form of possible German support or participation,” a government spokesman said.

In practice, the proposals will probably await a policy decision from the new prime minister and his foreign secretary.

The announcement of Boris Johnson’s premiership was greeted with concern by both reformist and conservative newspapers in Tehran, many of them calling him the “British Trump”, as the banner headline of the reformist Sazandegi read over a full-page picture of Johnson celebrating his win.

The conservative newspaper Jaam-e Jam noted Johnson had spoken of regime change in Iran, but added he had said he would not join a US-led war against Iran.

The reformist Etemaad’s headline read “Elected by hardliners”, warning Johnson wanted to get close to the US president. But the newspaper added: “Every day you can expect a fascinating event in the UK. Britain’s policy is a surprise to anyone following it every day.”

The conservative Resalat published a cartoon of Johnson in the manner of a British butler, being patted on the head by Trump at his desk in the Oval Office, claiming the hardliners were coming to power throughout Europe.