A court in Gibraltar ruled on Thursday that the Iranian tanker Grace 1, seized by British Royal Marines on July 4. The Iranian supertanker carrying 2,1 million barrels of oil was suspected of being bound for Syria, violating EU sanctions on the Assad regime.

The decision came after Gibraltar’s government received written assurances from Iran that Grace 1 would not deliver its cargo to any country subject to EU sanctions. Upon receiving such assurances, Gibraltar’s first minister, Fabian Picardo, stated that there were no longer any reasonable grounds for the legal detention of the vessel.

Gibraltar is a U.K. overseas territory at the mouth of the Mediterranean Sea. Tehran declared the takeover of the vessel an “act of piracy” and in retaliation seized the British-flagged Stena Impero tanker on July 19, in the Strait of Hormuz.

Asked by CNN on Thursday, Gibraltar’s first minister Picardo denied there was any notion of a swap between the two vessels. For his part, the British foreign secretary Dominic Raab told Sky News that there was never any intention “to barter a ship that was detained legally with a ship that was detained illegally.”

Immediately after the court ruling, Gibraltar’s government confirmed the release of the captain and three officers of Grace 1. However, Gibraltar Chronicle reported that the U.S. Department of Justice asked the Supreme Court of the British overseas territory to delay the release of the vessel. According to Gibraltar’s Chief Justice, without US involvement “the ship would have sailed” immediately.

According to Reuters, the US Department of Justice asked that the ship is not released, making reference to “a number of allegations” against the tanker.

The US has imposed sanctions on Iran with the aim of halting its oil exports altogether. However, European states have not followed Washington in this policy, but have kept in place an oil embargo on Syria since 2011. The US argument was considered by Gibraltar’s High Court but Grace 1 was released.

Throughout this dispute, the British foreign office insisted that the investigation surrounding Grace 1 was exclusively a matter for the government of Gibraltar. Boris Johnson’s new government in the UK has made clear that he is not willing to review British policy vis-à-vis Iran, although it was announced on Tuesday that UK naval forces will join a US-led mission in the Gulf.

The US blamed Iran for a number of attacks on tankers in the Strait of Hormuz in May and June; the passage is a strategic corridor for global oil trade, through which it is estimated that up to 20% of the global oil supply transits.