(CNN)A seized oil tanker at the center of a standoff between Britain 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, after authorities said they no longer wished to detain it.

Gibraltar’s Chief Minister said he had accepted a pledge from Iran that, were the tanker to be released, its cargo would not be taken to its suspected original destination of Syria, which would have been in contravention of EU sanctions against Riyadh.

At an earlier hearing, Gibraltar attorney general Joseph Triay said the US Department of Justice had applied to have the ship seized. The status of Washington’s legal efforts was unclear Thursday.

    After the Grace 1 was impounded by Gibraltar, Iran seized a British-flagged tanker in the Gulf. The status of that ship, the Stena Impero, remained unchanged Thursday, its owners said.

    A spokesperson for the Stena Impero’s owners said that the Grace 1 “is an entirely separate situation from our perspective” but its released “could be seen as a positive step” for the Stena Impero.

    A spokesman for Gibraltar’s attorney general separately announced that the captain of the Grace 1 and three officers would be released.

    A stern view of the Grace 1 super tanker in the British territory of Gibraltar on Thursday.

    British Royal Marines and Gibraltar port and law enforcement agencies stormed the ship on July 4 under the belief that the vessel carried oil destined for Syria, which would have been in violation of European Union sanctions.

    “We have reason to believe that the Grace 1 was carrying its shipment of crude oil to the Baniyas Refinery in Syria,” Spain’s acting foreign minister, Josep Borrell, said at the time, adding that the United States had asked the UK to intercept the ship. Gibraltar is an British overseas territory on the edge of southern Spain.

    Iran has criticized the seizure as “illegal” and condemned the operation as “piracy,” according to a report at the time from the semi-official Tasnim news agency.

    Less than two weeks later, Iran’s Islamic Revolutionary Guard Corps (IRGC) said its navy had captured a British-flagged oil tanker, Stena Impero, in the Strait of Hormuz and accused it of “violating international regulations.”

    Crew members stand on the Grace 1 supertanker earlier on Thursday.

      Jeremy Hunt, the UK’s then-Foreign Secretary, said in a statement that the incident showed “worrying signs Iran may be choosing a dangerous path of illegal and destabilizing behavior,” and added that the UK’s response would be “considered, but robust.” Nearly a month later, the tanker — and its crew — remain detained in Iran.

      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.

      CNN’s David Shortell, Kylie Atwood, Bianca Britton and Ivana Kottasova contributed to this report.