Authorities in Gibraltar have released the Iranian oil tanker, the Grace 1, at the centre of a diplomatic dispute between Tehran and London.

The Grace 1, carrying 2.1 million barrels of oil, was seized by royal marines last month, as the UK claimed it was aiming to deliver oil to Syria in violation of EU sanctions.

Gibraltar’s chief minister Fabian Picardo reportedly lifted the detention order and said the government has received “formal written assurances” from the Iranian government that the ship will not discharge its cargo in Syria, according to local newspaper the Gibraltar Chronicle.

Britain said that Iran must abide by these assurances, and said it would not allow Iran or anyone to bypass European Union sanctions.

“We note the government of Gibraltar has received assurances from Iran that the Grace 1 will not proceed to Syria. Iran must abide by the assurances they have provided,” a British foreign office spokesperson said in a statement.

In photos: British-flagged tanker seized by Iran Show all 13 1 /13 In photos: British-flagged tanker seized by Iran In photos: British-flagged tanker seized by Iran A speedboat of Iran's Revolutionary Guard moving around the British-flagged oil tanker Stena Impero Tasnim News Agency/AP In photos: British-flagged tanker seized by Iran Crew members of the British-flagged tanker Stena Impero, that was seized by Iran in the Strait of Hormuz EPA/IRIB News Agency In photos: British-flagged tanker seized by Iran A satellite image of the Iranian port city of Bandar Abbas reveals the presence of the seized British oil tanker, the Stena Impero on July 22 Maxar Technologies/Reuters In photos: British-flagged tanker seized by Iran Iranian Revolutionary Guard Corps (IRGC) claims to have seized Stena Impero at the Strait of Hormuz with 23 crew on board on 20 July EPA/IRIB News Agency In photos: British-flagged tanker seized by Iran Iranian Revolutionary Guards patrolling around the captured British-flagged tanker Stena Impero as it's anchored off the Iranian port city of Bandar Abbas AFP/Getty In photos: British-flagged tanker seized by Iran epa07733612 A handout photo made available by Iranian state-run IRIB News Agency on 22 July 2019 shows crew members of the British-flagged tanker Stena Impero, that was seized by Iran in the Strait of Hormuz on 19 July 2019. Iranian Revolutionary Guard Corps (IRGC) claims to have seized Stena Impero at the Strait of Hormuz with 23 crew on board on 20 July 2019. EPA/IRIB NEWS AGENCY / HANDOUT HANDOUT EDITORIAL USE ONLY/NO SALES IRIB NEWS AGENCY / HANDOUT EPA/IRIB News Agency In photos: British-flagged tanker seized by Iran A satellite image of the Iranian port city of Bandar Abbas reveals the presence of the seized British oil tanker, the Stena Impero on July 22 Maxar Technologies/Reuters In photos: British-flagged tanker seized by Iran A speedboat of the Iran's Revolutionary Guard moves around a British-flagged oil tanker Stena Impero AP In photos: British-flagged tanker seized by Iran epa07733614 A handout photo made available by Iranian state-run IRIB News Agency on 22 July 2019 shows crew members of the British-flagged tanker Stena Impero, that was seized by Iran in the Strait of Hormuz on 19 July 2019. Iranian Revolutionary Guard Corps (IRGC) claims to have seized Stena Impero at the Strait of Hormuz with 23 crew on board on 20 July 2019. EPA/IRIB NEWS AGENCY / HANDOUT HANDOUT EDITORIAL USE ONLY/NO SALES IRIB NEWS AGENCY / HANDOUT EPA/IRIB News Agency In photos: British-flagged tanker seized by Iran In this photo released by state-run IRIB News Agency, which aired on Monday, July 22, 2019, shows cooks in the galley of the British-flagged tanker Stena Impero that was seized by Tehran in the Strait of Hormuz on Friday. The Associated Press cannot independently verify the condition of the crew members, but in the video they looked to be in good health and it didn't appear as though they were being filmed under duress. (IRIB News Agency via AP) AP In photos: British-flagged tanker seized by Iran epa07733619 A handout photo made available by Iranian state-run IRIB News Agency on 22 July 2019 shows crew members of the British-flagged tanker Stena Impero, that was seized by Iran in the Strait of Hormuz on 19 July 2019. Iranian Revolutionary Guard Corps (IRGC) claims to have seized Stena Impero at the Strait of Hormuz with 23 crew on board on 20 July 2019. EPA/IRIB NEWS AGENCY / HANDOUT HANDOUT EDITORIAL USE ONLY/NO SALES IRIB NEWS AGENCY / HANDOUT EPA/IRIB News Agency In photos: British-flagged tanker seized by Iran epa07733613 A handout photo made available by Iranian state-run IRIB News Agency on 22 July 2019 shows crew members of the British-flagged tanker Stena Impero, that was seized by Iran in the Strait of Hormuz on 19 July 2019. Iranian Revolutionary Guard Corps (IRGC) claims to have seized Stena Impero at the Strait of Hormuz with 23 crew on board on 20 July 2019. EPA/IRIB NEWS AGENCY / HANDOUT HANDOUT EDITORIAL USE ONLY/NO SALES IRIB NEWS AGENCY / HANDOUT EPA/IRIB News Agency In photos: British-flagged tanker seized by Iran epa07733616 A handout photo made available by Iranian state-run IRIB News Agency on 22 July 2019 shows crew members of the British-flagged tanker Stena Impero, that was seized by Iran in the Strait of Hormuz on 19 July 2019. Iranian Revolutionary Guard Corps (IRGC) claims to have seized Stena Impero at the Strait of Hormuz with 23 crew on board on 20 July 2019. EPA/IRIB NEWS AGENCY / HANDOUT HANDOUT EDITORIAL USE ONLY/NO SALES IRIB NEWS AGENCY / HANDOUT EPA/IRIB News Agency

“We will not stand by and allow Iran – or anyone – to bypass vital EU sanctions on a regime that has deployed chemical weapons against its own people.

“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 EU Syria sanctions by the government of Gibraltar.“

Earlier on Thursday, the US government applied to officially seize the ship from Gibraltar control.

According to Reuters, Gibraltar has said there are “no longer any grounds to keep Grace 1 detained”, and the US request to officially seize the ship was a matter for mutual legal assistance authorities who “will make an objective determination”.

The British detention of the Iranian ship prompted Iran to seize the British-flagged tanker the Stena Impero, which remains under the control of the country.

The Grace 1’s captain, an Indian national, and three officers were also released early on Thursday.

Gibraltar has said it expects the tanker to set sail soon.

Iran’s ambassador to the United Kingdom, Hamid Baeidinejad said the US faces “humiliation” with “its frantic last-minute efforts”.

In a tweet in Persian, he said: “With the efforts of the past few days, all the preparations and technical arrangements for the oil tanker to move to the high seas have been provided and the ship will soon leave the Gibraltar region.”

Iran’s foreign minister used stronger language, saying the US had failed in its attempts at “economic terrorism” in the form of sanctions and described efforts to seize the ship as a “piracy attempt”.

Javad Zarif said: “Having failed to accomplish its objectives through its economic terrorism – including depriving cancer patients of medicine – the US attempted to abuse the legal system to steal our property on the high seas.