* Gibraltar to free Iranian ship
* Iran says Grace 1 to sail soon
* Grace 1 was seized by Gibraltar on July 4
* Iran has a British-flagged vessel
* U.S. seeks to seize the Grace 1 (Recasts headline and lead)
By Guy Faulconbridge and Marco Trujillo
LONDON/GIBRALTAR, Aug 15 (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.
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."
Iran said the ship would sail shortly. Foreign Minister Mohammad Javad Zarif characterised 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 London, Hamid Baeidinejad, said on Twitter.
"All preparations are done for the tanker to sail into open waters, and the vessel will soon leave Gibraltar."
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.
Britain has been in a delicate diplomatic position since seizing the ship. 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 would not be freed until the Iranian tanker is released.
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 disagreed with Washington's decision last year to abandon the 2015 nuclear deal, an international agreement that guaranteed Iran access to trade in return for curbs to its atomic programme.
Washington has imposed sanctions on Iran with the aim of halting its oil exports altogether. European countries have lifted sanctions against Iran itself, although 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 on Sunday to Tuesday, offering Washington'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. (Additional reporting by Michael Holden, Kate Holton, William James, Estelle Shirbon, Bozorgmehr Sharafedin; writing by Guy Faulconbridge; editing by)
Our Standards: The Thomson Reuters Trust Principles.