A South Korean flagged tanker and its captain detained in Iran in January were released, foreign ministry in Seoul said.
Iran seized the Hankuk Chemi near the strategic Strait of Hormuz, accusing it of violating pollution rules.
All the 20 crew members were set free in February, apart from the captain.
The incident happened amid tensions over Iranian funds frozen in South Korean banks because of US sanctions. Iran said the cases were not linked.
But the release of the ship and the captain comes amid reports Seoul and Tehran have made some progress in unlocking the funds, which total USD $7 billion.
“The captain and sailors are in good health, and it’s been confirmed that the ship and its cargoes had no problems,” the ministry said, according to Reuters news agency.
“The ship departed Iran after completing administrative procedures.”
The operator of the tanker, which was carrying chemicals, denied the charge. The 20 crew included 11 Myanmar nationals, five South Koreans, two Vietnamese and two Indonesians.
Iran insisted that the seizure was not linked to the row over the Iranian funds, which have been frozen since the US reinstated economic sanctions on Iran in 2018 after abandoning a landmark nuclear deal.