Iran is allowing all crew members of a South Korean-flagged tanker it seized in the Gulf a month ago to leave the country except for the captain.
A foreign ministry spokesman said 19 of the Hankuk Chemi’s sailors would be released on humanitarian grounds following a request from Seoul.
He also said South Korea had agreed to try to speed up the unfreezing of $ 7bn (£5bn) in Iranian funds in its banks.
South Korea’s foreign ministry said the move would help “restore trust”.
Iranian forces detained the Hankuk Chemi near the strategic Strait of Hormuz on 4 January, accusing it of “causing environmental pollution”.
The operator of the tanker, which was carrying chemicals, denied the charge.
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.
The 20 crew – 11 Myanmar nationals, five South Koreans, two Vietnamese and two Indonesians – were detained in the port city of Bandar Abbas.
“Following the request by the government of South Korea and the goodwill of the judiciary within the framework of the law, the crew of the Korean tanker, which was responsible for polluting the Persian Gulf, have been given permission to leave the country on humanitarian grounds,” Iranian foreign ministry spokesman Saeed Khatibzadeh said on Tuesday.
The investigation into the tanker and its captain was continuing, he added.
The Iranian announcement came after Deputy Foreign Minister Abbas Araqchi spoke by telephone with his South Korean counterpart, Choi Jong-kin.
During the conversation, Mr Choi had stressed that South Korean authorities were exerting “maximum effort to speed up releasing Iranian foreign exchange holdings”, Mr Khatibzadeh said.
South Korea’s foreign ministry later said that the two sides “shared the view that the release of the sailors was an important first step to restore trust between the two countries and they will work to resolve the issue of frozen Iranian assets in South Korean banks”.
“[Mr] Choi also said South Korea will do what it can in a speedy manner while discussing consultations with the United States on the issue,” it added.
The ministry said it was in talks with the Hankuk Chemi’s operator to discuss issues related to the release of the sailors and their return home.
The captain would remain in Iran to take care of the tanker, it added.
Mr Choi called on the Iranian authorities to release the captain and the tanker as soon as possible.