LONDON/GIBRALTAR (Reuters) - Britain’s Mediterranean territory Gibraltar decided on Thursday to free a seized Iranian oil tanker, but did not immediately indicate when or if the ship would set sail after the United States launched a new, last-minute legal bid to hold it.

The Grace 1 was seized by British Royal Marine commandos in darkness off the coast of the territory at the western mouth of the Mediterranean on July 4 on suspicion of violating European Union sanctions by taking oil to Syria, a close ally of Iran.

Two weeks later, Iran seized a British-flagged tanker in the Strait of Hormuz leading into the Gulf.

The two tankers have become pawns in the standoff between Iran and the West, their fate tangled up in the diplomatic differences between the EU’s big powers and the United States.

Gibraltar Chief Minister Fabian Picardo decided to lift the detention order after formal written assurances from Tehran that the ship would not discharge its 2.1 million barrels of oil in Syria.

“In light of the assurances we have received, there are no longer any reasonable grounds for the continued legal detention of the Grace 1 in order to ensure compliance with the EU Sanctions Regulation,” Picardo said.

However, Gibraltar officials did not make clear whether the U.S. legal bid would mean the ship would have to be detained further or, if so, for how long.

“Separately, the United States Department of Justice has requested that a new legal procedure for the detention of the vessel should be commenced,” Picardo said. “That is a matter for our independent Mutual Legal Assistance authorities who will make an objective, legal determination of that request for separate proceedings.”

In a statement, the U.S. State Department said the United States had determined that the ship was helping Iran’s Islamic Revolutionary Guard Corps, which Washington has designated as a terrorist organization.

“In the case of the M/T Grace I, we will continue to act consistent with our existing policies concerning those who provide material support to the IRGC,” the State Department said.

Iran said the ship would sail shortly, and Foreign Minister Mohammad Javad Zarif characterized the U.S. bid to prevent it from leaving as “piracy”.

“America desperately tried to block the release of the tanker at the last minute, but faced a miserable defeat,” Iran’s ambassador to Britain, Hamid Baeidinejad, said on Twitter. “All preparations are done for the tanker to sail into open waters, and the vessel will soon leave Gibraltar.”

The tanker remains anchored, Reuters witnesses said, though its prow has moved around by at least 180 degrees. It was unclear whether that was due to the strong sea currents off Gibraltar or if it could be preparing to sail.

Slideshow ( 21 images )

Earlier, a small vessel approached the Grace 1, which lowered a step ladder that at least two person used to reach the ship deck where they shook hands with people already on board.

Jalil Eslami, deputy head of Iran’s Ports and Maritime Organisation, told the semi-official Mehr news agency the Grace 1 would head to “Mediterranean ports”, citing “an announcement by the owner of the tanker”. Eslami did not identify the owner.

Britain’s Foreign Office said Iran must abide by its pledge that the ship would not sail for Syria. There was “no comparison or linkage between Iran’s unacceptable and illegal seizure of, and attacks on, commercial shipping vessels in the Strait of Hormuz and the enforcement of EU Syria sanctions by the Government of Gibraltar,” it added in a statement.

Slideshow ( 21 images )

Britain has been in a delicate diplomatic position since seizing the Grace 1. The United States is its closest ally, but like other European countries it disagrees with U.S. President Donald Trump’s hardline policy on Iran, after Trump pulled out of a nuclear deal between Iran and world powers last year.

Several diplomatic sources have said Britain seized the vessel at the request of the United States, although Gibraltar denies that it was ordered to do so.

Although Britain and Iran have both denied that they would swap the tankers for each other, there has been a widespread expectation that the British-flagged Stena Impero will not be freed until the Iranian tanker is released.

TANKER PAWNS

Erik Hanell, CEO and president of the owner of the Stena Impero, Stena Bulk, said “any event which contributes in any way” to getting the crew of its ship free in Iran “must be viewed as positive”.

European countries including Britain strongly disapproved of Trump’s abandonment of the 2015 nuclear deal, an international agreement that guaranteed Iran access to trade in return for curbs to its atomic program.

The Trump administration has imposed sanctions on Iran with the aim of halting its oil exports altogether. European countries have lifted sanctions against Iran itself though they still have a ban on selling oil to Syria, in place since 2011.

Britain, which has insisted its Iran policy will not change under new Prime Minister Boris Johnson, who took office last month, has repeatedly indicated it wants a compromise over the tanker.

U.S. national security adviser John Bolton visited London from Sunday to Tuesday, offering U.S. help on Britain’s exit from the EU, due on Oct. 31. Britain has announced plans to join a U.S.-led maritime security mission in the Gulf.