Iran says it will free on humanitarian grounds seven of the 23 crew members of a Swedish-owned, British-flagged tanker seized in the Strait of Hormuz in July.
The sailors - five Indians, one Latvian and one Russian - had already left the Stena Impero, a foreign ministry spokesman told state television.
Iran accuses the vessel of "violating international maritime rules".
The seizure came two weeks after an Iranian tanker was held off Gibraltar with the help of the Royal Marines.
That ship, now called the Adrian Darya 1, was suspected of violating EU sanctions on Syria but it was released by Gibraltar on 15 August.
The Stena Impero was passing through international waters in the Strait of Hormuz, a narrow waterway that connects the Gulf and the Indian Ocean, on 19 July when it was detained by Iran's Islamic Revolution Guard Corps.
Video footage showed troops descending from a helicopter on to the deck.
The UK says a Royal Navy frigate deployed in the Gulf tried to come to the tanker's aid and warned the Iranians by radio that their actions were illegal, but that it was unable to reach the scene in time.
The Stena Impero was brought to the Iranian port of Bandar Abbas, where it remains at anchor.
Its Swedish operator, Stena Bulk, said last month it had been able to maintain limited communication with the crew and that they remained in good health "considering the circumstances". But it expressed concern about their welfare.
BBC
BDST: 1655 HRS, SEPT 4, 2019
SI