The Iranian oil tanker Grace 1 sits anchored on Wednesday, after it was seized in July by British Royal Marines off the coast of Gibraltar. (Jon Nazca/Reuters)

Gibraltar’s government Thursday released an Iranian supertanker detained on suspicion of violating European Union sanctions on oil exports to Syria, authorities said, in a move likely to soothe tensions with Iran even as it drew opposition from the Trump administration.

The Grace 1 tanker was seized last month near Gibraltar, a British overseas territory, with 2.1 million barrels of oil, which the government suspected was destined for the Syrian port Baniyas. Its detention was at the center of a brewing crisis between Iran and the British government, which helped Gibraltar authorities impound the ship.

At a hearing on the ship’s seizure Thursday, a lawyer for Gibraltar’s attorney general surprised the court when he revealed that the United States had lodged a last-minute appeal to block the vessel’s release. The government of Gibraltar said it was not seeking to further detain the ship.

Authorities said that the Justice Department, which declined to comment, had “applied to seize the Grace 1 on a number of allegations,” a move that would kick-start separate legal proceedings.

Despite the plea, Gibraltar’s supreme court granted the government’s request to free the vessel and its crew.

Gibraltar’s chief minister, Fabian Picardo, said he had received written assurances from Iran about the ship’s cargo and destination, but did not elaborate.

“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 E.U. Sanctions,” Picardo said, adding that he had met with Iranian officials in London last month to de-escalate the crisis.

He said that the petition from the Justice Department would be assessed under what is known as mutual legal assistance, where two or more countries agree to formally exchange information or gather evidence.

Those authorities “will make an objective, legal determination of that request,” Picardo said. 

It was unclear how the U.S. appeal would affect the ship’s status. But the developments Thursday added to the month-long saga over the tanker, whose seizure raised the temperature in the Persian Gulf region, a venue for tensions between Iran and the United States and its allies. 

Iranian officials threatened British shipping assets in the gulf, and last month Iranian naval forces seized the British-flagged Stena Impero in the Strait of Hormuz. 

“There is 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 E.U. Syria sanctions by the Government of Gibraltar,” a spokesman for Britain’s Foreign Office said in a statement on the Gibraltar court’s decision Thursday. 

“Iran must abide by the assurances they have provided” regarding the ship’s travel to Syria, whose government is a key Iranian ally. 

“We will not stand by and allow Iran — or anyone — to bypass vital E.U. sanctions on a regime that has deployed chemical weapons against its own people,” the spokesman said, referring to the Syrian government. 

The United States has embarked on a campaign to isolate Iran, imposing harsh sanctions on its economy and aggressively targeting Iranian oil exports. The Trump administration says the measures are designed to pressure Iran to negotiate a broader deal with the United States over its ballistic missiles, nuclear activities and support for proxy forces in the region.

Trump withdrew from the nuclear deal Iran struck with world powers in 2015, an agreement that curbed its atomic energy activities in return for widespread sanctions relief.

Commenting on the Grace 1 on Twitter Thursday, Iranian Foreign Minister Mohammad Javad Zarif said that the U.S. government had “attempted to abuse the legal system to steal our property on the high seas.”

“This piracy attempt is indicative of Trump admin’s contempt for the law,” said Zarif, who has sanctions imposed on him by the United States.