TEHRAN, Iran—Iranian forces seized a British-flagged oil tanker in the Strait of Hormuz, as mounting tensions between Tehran and the West risked further disruption of commercial shipping in the strategically vital waterway.

A second vessel, this one British managed, was boarded by armed Iranian personnel in the Persian Gulf on Friday and later freed, its U.K. managers and a British shipping official said.

Friday’s developments came hours after a court in the British territory of Gibraltar extended the detention of an Iranian oil tanker seized earlier this month by British authorities who said it was breaching European sanctions on Syria. Iran had threatened retaliation for that seizure.

Tensions have mounted steadily in the Persian Gulf as Washington has tightened economic sanctions against Iran in an effort to force Tehran to negotiate new limits on its nuclear program and military activities.

Even as Washington and Tehran both insist they don’t want a war, recent incidents have raised fears of a miscalculation that could lead to a wider armed conflict in the Middle East.