GIBRALTAR - 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 boarded 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.

Grace 1’s owner said the released Iranian tanker would head to the Mediterranean, according to Iran’s semi-official Mehr News Agency, citing Iranian Maritime official Jalil Eslami. It was unclear when the supertanker would depart.

On Friday, Iran disputed Gibraltar’s account and insisted it had made no commitments to secure the tanker’s release.

“Iran has made no commitment that the ship would not go to Syria because from the early hours of the tanker’s detention, we announced that Syria was not its destination and we have upheld the same ... and reiterated that it was nobody’s business even if it was Syria,” the country’s Foreign Ministry spokesman Seyed Abbas Mousavi said according to semi-official Tasnim news.

According to Tasnim, Mousavi said that the Gibraltar government “raised the issue of commitment in a bid to make up for their humiliation caused by this illegal act and piracy.”

“We support Syria in all areas, including oil and energy,” Mousavi said, adding, “This is legal and has nothing to do with any third country.”

A last-minute intervention by the US threatened to scupper the plan 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.

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.

The US reacted to the release by threatening to revoke visas for the Grace 1’s crew. The State Department said in a statement late Thursday that it had deemed the ship to be “assisting” Iran’s Islamic Revolutionary Guard Corps (IRGC), which the US has designated a Foreign Terrorist Organization, in evading sanctions.