(SOUNDBITE) (English) GIBRALTAR LAWYER WHO ATTENDED THE HEARING, CHARLES GOMEZ, SAYING: "The arrest, therefore is no longer valid and the vessel can leave immediately." Gibraltar has released the Iranian oil tanker detained by British marines last month.
The supertanker Grace 1 was seized on suspicion of carrying oil to Syria, in defiance of European sanctions.
Then Iran seized a British tanker, the Stena Impero, in apparent retaliation.
The tale of two tankers was deeply entangled with the diplomatic standoff between Iran and the West.
There was no immediate news of a reciprocal release by Iran.
A spokesman for Stena Impero said they were still awaiting developments.
Thursday's (August 15) release of the Grace 1 was expected.
Its captain and three officers had already been set free.
But hours before, the plot thickened when UK officials said the United States had applied to seize the Grace 1, which appeared to scupper hopes of defusing tensions.
The chief justice of Gibraltar's supreme court said there was no U.S. application before it, while Iran's ambassador to London said the U.S. had been "desperately" trying to block the Grace 1's release.
EU nations have been trying to save Iran's nuclear deal with international powers.
Washington has pulled out of the agreement, but Europe wants to keep it alive.