DUBAI — Iran called on Britain on Friday to release an Iranian supertanker seized off the coast of ­Gibraltar last week, warning British authorities against playing a “dangerous and unclear” game.

“We call on [Britain] to release the oil tanker as soon as possible, because it would be in the interests of everyone,” Iranian Foreign Ministry spokesman Abbas Mousavi told the state-run Islamic Republic News Agency.

He questioned the legal basis for the ship’s detention, which authorities in Gibraltar said was a lawful seizure. Gibraltar is a British territory, and Britain’s royal marines assisted in the operation to apprehend the vessel in the Mediterranean last week. 

Authorities said it was carrying 2.1 million barrels of light crude to a refinery in the Syrian port ­Banias in violation of European Union sanctions. Police in Gibraltar arrested the ship’s captain and three officers and seized documents and electronic devices. 

“We acted because we had reasonable grounds to believe that this vessel was taking actions in breach of established E.U. sanctions against Syria,” Fabian Picardo, the chief minister of Gibraltar, told the territory’s parliament on Friday.

Mousavi said the claims are “without legal basis.”

“We advise [Britain] not to start a dangerous and unclear game under the influence of the Americans,” he said.

The confrontation over the Iranian tanker comes amid broader tensions between Iran and Western countries, in the Persian Gulf and over the 2015 nuclear deal Iran struck with world powers.

Britain said Thursday that Iranian vessels attempted to block the oil tanker British Heritage near the Strait of Hormuz but were repelled by a British naval escort. 

Iran has threatened to retaliate against British shipping assets in the gulf in response to the detention of the Grace 1 supertanker. 

The British government said Friday that the destroyer HMS Duncan is being deployed to assist in regional maritime security efforts, replacing the HMS Montrose. 

The deployment is meant to “ensure we maintain a continuous maritime security presence” in the Persian Gulf, the government said in a statement, according to Reuters news agency. “This will ensure that the UK alongside international partners can continue to support freedom of navigation for vessels transiting through this vital shipping” waterway.

In Brussels, European diplomats said Friday that they were working to preserve the nuclear deal after Iran’s decision this week to begin enriching uranium beyond levels set by the agreement. Earlier this month, Iran breached the 300-kilogram limit on its stockpile of enriched uranium.

The moves are part of a strategy to compel European nations to reset the deal’s terms and compensate Iran after a U.S. withdrawal from the pact last year, Iranian officials said. 

The United States abandoned the pact and reimposed sanctions on Iran in the fall, part of a “maximum pressure campaign” it hopes will persuade Iran to negotiate a broader deal that includes its ­ballistic-missile program and its support of proxy forces across the Middle East. 

“We want to do everything to preserve the nuclear agreement,” a senior E.U. diplomat said at a briefing Friday in Brussels. The diplomat spoke on the condition of anonymity to discuss the sensitive negotiations over the deal. 

European officials said they were not ready to take formal action against Iran for the violations, saying they did not think the measures signified a decision by Tehran to walk away from the accord. 

Birnbaum reported from Brussels. Quentin Ariès in Brussels contributed to this report.