Media playback is unsupported on your device Media caption Grace 1: Inside the seized supertanker

Gibraltar has freed an Iranian oil tanker detained last month on suspicion of sanctions-busting, despite a last-minute plea by the US authorities.

The UK territory received written assurances from Iran that the ship would not discharge its cargo in Syria.

Grace 1, carrying Iranian oil, was stopped by Royal Marines on 4 July, triggering a standoff with Tehran.

Gibraltar's chief justice, Anthony Dudley, said no US application was currently before the court.

An independent legal body would make a determination on the American request, Gibraltar's Chief Minister Fabian Picardo said in a statement.

The tanker remained off Gibraltar early on Thursday evening but, according to witnesses speaking to Reuters news agency, its prow had moved around by at least 180 degrees.

It was unclear whether this was because of strong sea currents or because it was preparing to leave.

The UK Foreign and Commonwealth Office said Iran must abide by the assurances it had given that the tanker would not proceed to Syria, which is under EU sanctions.

The FCO described Syria as a "regime that has deployed chemical weapons against its own people".

Iranian Foreign Minister Javad Zarif condemned the US attempt to stop the tanker's release, accusing the Trump administration of attempted "piracy".

A couple of weeks after the Iranian tanker was stopped, Iran seized a British-flagged tanker, the Stena Impero, in the Gulf and, despite official denials, there has been speculation of a swap if the Grace 1 is freed.

Relations between the US and Iran have deteriorated sharply since US President Donald Trump took office in 2017, with the two countries coming close to armed conflict in June.

The release of the Grace 1 inevitably raises all sorts of questions but it also points to a possible resolution of the stand-off between Britain and Iran.

The Iranians had detained the Stena Impero in apparent retaliation for the seizure of the Grace 1. While Britain insists that the two episodes are in no sense the same - one they argue is legal, the other not - the freeing of the Iranian tanker would seem to be an essential prerequisite for a resolution.

But where does this leave the Americans? They made a last-minute attempt to have the vessel turned over to them, but appear not to have lodged a formal legal request. Might they still have time to do this? What grounds would they have for doing so?

And how might such a move risk raising tensions in the Gulf further with the Iranian foreign minister already accusing Washington of attempted piracy?

How was the Iranian tanker seized?

It was stopped after the government of Gibraltar suggested it was heading for Syria.

Image copyright Reuters Image caption The Grace 1 off Gibraltar

About 30 marines were flown from the UK to Gibraltar to help police detain the tanker and its cargo, at the request of the Gibraltarian government.

The initial seizure of the tanker sparked a diplomatic crisis between the UK and Iran which escalated when the Stena Impero was seized on 19 July.

Last week, the UK announced it would join a US-led taskforce to protect merchant ships travelling through the key shipping route in the Strait of Hormuz.

Almost a fifth of the world's oil passes through the narrow strait, which lies off the south coast of Iran.

Why did the court not consider the American request?

Confirming that the tanker had been "released from detention", Mr Picardo explained that the US justice department had requested that a "new legal procedure for the detention of the vessel should be commenced".

"That is a matter for our independent Mutual Legal Assistance authorities who will make an objective, legal determination of that request for separate proceedings," he said.

What is the situation of the British tanker?

The Stena Impero, which is British-flagged but Swedish-owned, is anchored in the Iranian port of Bandar Abbas, 27 days after being detained.

Tehran said Stena Impero had been "violating international maritime rules" but the UK called its detention an example of "state piracy".

Image copyright AFP

Global seafarers' charity Stella Maris said it hoped the release of Grace 1 might in turn lead to the release of the Stena Impero's crew.

Iran released photos of the crew aboard the tanker last month, showing cooks preparing meals and crew members being briefed by an Iranian official.

Most of the crew of 23 are Indians while the others are of Russian, Latvian or Philippine nationality.

Most of the 28 members of the Grace 1's crew are also believed to be Indians.

Why are US relations with Iran so strained?

Washington suspects Iran of continuing efforts to develop nuclear weapons, something Tehran has always denied, and also accuses it of seeking to destabilise the Middle East.

Last year, the US withdrew from a 2015 deal to limit Iran's nuclear activities and re-imposed sanctions against the country.

The UK and other European countries have said they remain committed to the deal.

Washington has also blamed Iran for a series of attacks on tankers in waters off Gulf Arab states over the summer, an accusation Tehran denies.

In June, Mr Trump was reportedly on the verge of bombing sites in Iran in response to the downing of an American drone.