The Gibraltar Supreme Court on Thursday allowed an Iranian oil tanker detained in early July to leave despite a US request to extend its detention on suspicion of seeking to deliver its cargo to Syria.
Iran has confirmed in writing that the Grace 1 payload is not directed at Syria, which is under European embargo, and the British authorities in Gibraltar have therefore asked the court to lift it.
"The ship is no longer in custody," Judge Dudley said.
Dudley said he had not received any written request from the United States to extend the detention of the ship after the prosecution announced this before noon.
"It was not presented to me," he said.
But the court´s decision does not prevent the United States from submitting its request for the detention of the tanker before it leaves Gibraltar´s territorial waters in the coming hours or days.
Iranian Foreign Minister Mohammad Javad Zarif said the US hacking attempt had failed.
"Having failed to achieve its goals through economic terrorism, including depriving cancer patients of medicines, the United States has tried to misuse the law to steal our property at sea," Zarif wrote on Twitter.
"This piracy attempt underscores the contempt of the Trump administration for the law," he said.
Iran´s ambassador to London called the ruling a "humiliating defeat" for the United States.
"A few minutes ago ... the tanker carrying Iranian oil was released from unlawful detention," he wrote on Twitter.
He added that "the United States with its cowardly attempts at the last minute sought to prevent the tanker not to remain in detention, and faced a humiliating defeat."
But the chief justice said he had not received a US written request to detain the tanker after his decision was announced on Thursday.