LONDON—A British warship will accompany British-flagged vessels through the Strait of Hormuz to defend freedom of navigation, a change in policy after the government previously said it did not have the military resources to do so.

Tensions have spiked between Iran and Britain since the Islamic Republic seized a British-flagged tanker in the Strait last Friday. Its move came after British forces captured an Iranian oil tanker near Gibraltar which Britain said was heading for Syria in defiance of EU sanctions.

The British government has previously advised British-flagged vessels to avoid the Strait of Hormuz where possible and to notify the navy if they must cross it.

HMS Montrose, a British frigate now in the area, will accompany the vessels, a government spokesman said.

“The Royal Navy has been tasked to accompany British-flagged ships through the Strait of Hormuz, either individually or in groups, should sufficient notice be given of their passage,” the spokesman said.

“Freedom of navigation is crucial for the global trading system and world economy, and we will do all we can to defend it,” he added in a statement.

Britain has been seeking to put together a European-led maritime protection mission to ensure safe shipping through the Strait of Hormuz after Iran’s seizure of the tanker in what London said was an act of “state piracy.”

Jeremy Hunt, who was foreign secretary until a cabinet reshuffle on July 23, said on July 22 it was “not possible for the Royal Navy to provide escorts for every single ship.”

The change of policy was not the result of a change of under new Prime Minister Boris Johnson. The government had been working on the plan for a few days, according to an official, who asked not to be named.

The Department for Transport is advising shipping companies to give sufficient notice of their travel plans so they can be protected.

On any given day, about 15 to 30 large British-flagged ships travel through the Gulf, with up to three passing through the Strait of Hormuz.

The United States, Britain and other nations will be meeting in Florida on July 24 to discuss how to protect shipping in the Gulf from Iran.

Washington, which has by far the strongest Western naval contingent in the Gulf, has been calling for its allies to join it in an operation to guard shipping there. But European countries, which disagree with a U.S. decision to impose sanctions on Iran, have been reluctant to sign up to a U.S.-led mission for fear of adding to tension in the region.

France, Italy and Denmark support the idea of an EU-led flotilla in the Gulf, three EU diplomats said on July 23. Germany has said it is too early to discuss how Berlin might take part.

Iran says it is the guarantor of security in the strait. It will not allow any disturbance in shipping there, state news agency quoted Deputy Foreign Minister Abbas Araqchi as saying on July 23.