Iran on Friday released a South Korean-flagged tanker it seized amid a dispute over billions in frozen oil funds, and the vessel's captain, the foreign ministry in Seoul said.

The Islamic Revolutionary Guard Corps seized the Hankuk Chemi and its multinational crew of 20 sailors in January, but South Korea's foreign ministry said in a statement that its detention had been lifted and "the ship departed safely today".

At the time of the seizure Tehran accused the vessel of "repeated infringement of maritime environmental laws".

The move came after Tehran had urged Seoul to release billions of dollars of Iranian assets frozen in South Korea under US sanctions over its nuclear programme.

Tehran said in February that all the crew except the captain would be allowed to leave the country as a humanitarian gesture, but most of them remained on board to maintain the ship.

Iran was a key oil supplier to resource-poor South Korea until Washington's rules blocked the purchases, and Tehran says it has a total of $7 billion of funds blocked in Seoul.

South Korea had said in February it agreed on a way forward to release billions of dollars frozen from Iran's oil sales -- but was awaiting Washington's approval.

US Secretary of State Antony Blinken last month signalled Washington would be opposed to releasing the money unless the Islamic republic returned to full compliance with the nuclear accord that the United States withdrew from under president Donald Trump.

Tehran said in February that all the crew except the captain would be allowed to leave the country as a humanitarian gesture, but most of them remained on board to maintain the ship
Tehran said in February that all the crew except the captain would be allowed to leave the country as a humanitarian gesture, but most of them remained on board to maintain the ship South Korean Foreign Ministry / Handout

South Korea's foreign ministry made no mention of the funds in its statement Friday.

But multiple South Korean media reports say Prime Minister Chung Sye-kyun will visit Tehran soon, without giving a date for the trip.

Tehran has repeatedly denied that the seizure of the vessel was linked to the funds issue.

The Hankuk Chemi incident was the first seizure of a major vessel by Iran's naval forces in more than a year.

In July 2019, the Guards seized the British-flagged oil tanker Stena Impero in the Strait of Hormuz for allegedly ramming a fishing boat. They released it two months later.

At the time it was widely seen as a tit-for-tat move after authorities in the British overseas territory of Gibraltar detained an Iranian tanker and later released it, despite US objections.

Tehran denied the two cases were related.

The Guards seized at least six other ships in 2019 over alleged fuel smuggling.