TEHRAN - 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.

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.

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.

“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.