The oil tanker Stena Impero seen leaving Iran (Picture: MOD).
A British-flagged tanker has arrived in Dubai after being held in an Iranian port for two months.
On Friday morning, the Stena Impero and its crew left the port of Bandar Abbas, on the southern coast of Iran.
The vessel was seized by the Islamic Revolutionary Guard Corps in the Strait of Hormuz on 19 July, accused of violating international maritime law.
The Foreign Office and the ship's Swedish owner, Stena Bulk, both welcomed the Stena Impero's departure, which came amid heightened tensions between Iran and the west.
Stena Bulk said the crew headed to Dubai for medical checks and that all those on board "are safe and in high spirits".
Foreign Secretary Dominic Raab said: "The Stena Impero was unlawfully seized by Iran.
"It is part of a pattern of attempts to disrupt freedom of navigation.
"We are working with our international partners to protect shipping and uphold the international rule of law."
On Monday, Iranian government spokesman Ali Rabiei told journalists that legal proceedings against the Stena Impero had ended.
"Based on a friendly approach that allows forgiving mistakes, ground for freedom of the tanker has been paved and it can move," Mr Rabiei said.
The Stena Impero's seizure in July came after Royal Marines in Gibraltar seized an Iranian tanker carrying 130 million dollars (£104 million) in crude oil on suspicion of it breaking European Union sanctions on Syria.
Gibraltar later released the tanker, then called the Grace 1 but later renamed Adrian Darya 1, after it said Iran had promised the ship would not go to Syria.
The ship seizures came after months of heightened tensions in the Persian Gulf, sparked by US President Donald Trump's decision to withdraw from Iran's nuclear deal last year.
Iran has since begun breaking the terms of the deal, which Prime Minister Boris Johnson described as "bad" in a change of UK policy, and called for a new accord to be brokered.