A seized oil tanker at the center of a standoff between the UK and Iran is free to set sail, despite eleventh-hour efforts by the United States to halt the move to release it.
The Supreme Court in the British territory of Gibraltar approved the release of the Grace 1, which was seized off the country's coast by authorities last month, after officials said they no longer wished to detain it.
Gibraltar said it had received assurances from Iran and the owners of the oil that, were the tanker to be released, its cargo would not be taken to Syria, which would be in breach of European Union sanctions.
The ship was seized six weeks ago as it passed through Gibraltar's territorial waters. Two weeks later, Iran seized a British ship in the Gulf, in what was widely regarded as a tit-for-tat operation.
As tensions increased, the two sides conducted delicate negotiations in London. "Gibraltar has taken a very careful approach to the detention of Grace 1," Gibraltar's Chief Minister Fabian Picardo told CNN "We only acted in July when we had evidence that the cargo aboard the vessel was going to Syria."
"What we found aboard the vessel has confirmed the view that we took was the correct view. We have only released the vessel... when we have been convinced that the vessel is not now going to Syria," he added.
A last-minute intervention by the US threatened to scupper the deal to release the Grace 1. In a court hearing Thursday morning, instead of announcing the release of the tanker, the Gibraltar attorney general's lawyer Joseph Triay said the US Department of Justice had applied to extend its seizure. The basis of Washington's legal efforts was unclear Thursday. The State Department referred CNN to the Department of Justice, which declined to comment.
The court adjourned until later Thursday afternoon, when the release of the Grace 1 was confirmed.
Picardo told CNN that Gibraltar was still looking at the request from the US and "making an independent assessment" of it. That review had not been completed ahead of Thursday's court hearings "but could of course come at any time before the vessel sails." Picardo declined to elaborate on the basis of the US request to extend the seizure of the vessel.
Iran's Foreign Minister Javad Zarif denounced the US move as a "piracy attempt," in a post on Twitter.
Tehran's ambassador to the UK, Hamid Baeidinejad, said the Grace 1 would leave Gibraltar soon. "The US in a last minute attempt made a futile effort to block the release of the oil tanker and were faced with humiliating defeat. With recent attempts, all necessary preparations and technical issues to release the tanker to an open sea have been arranged and the ship will soon leave Gibraltar," he wrote on Twitter, in Farsi.
British Royal Marines and Gibraltar port and law enforcement agencies stormed the ship on July 4. It was accused of carrying oil destined for Syria, which would have been in violation of EU sanctions.
Spain's acting foreign minister, Josep Borrell, said at the time that the United States had asked the UK to intercept the ship. Gibraltar is a British overseas territory on the edge of southern Spain.
Iran has criticized the seizure as "illegal" and condemned the operation as "piracy."
Less than two weeks later, Iran's Islamic Revolutionary Guard Corps (IRGC) captured the British-flagged Stena Impero in the Strait of Hormuz and accused it of "violating international regulations."
A spokesperson for the Stena Impero's owners said that the Grace 1 "is an entirely separate situation from our perspective" but its release "could be seen as a positive step" for the Stena Impero.
Prior to the seizures, tensions in the Persian Gulf had been steadily escalating after Iran confirmed it would stop complying with several parts of the 2015 nuclear deal, which the Trump administration withdrew from last year.
This story has been updated to clarify that Joseph Triay is the Gibraltar attorney general's lawyer.
CNN's Artemis Moshtaghian, Barbara Wojazer, David Shortell, Kylie Atwood, Bianca Britton and Ivana Kottasova contributed to this report.