South Korea will release about $7 billion in frozen funds to Tehran, the Asian country's foreign ministry said on Tuesday.
Iran's Central Bank governor, Abdolnaser Hemmati, met South Korean ambassador Ryu Jeong-hyun and was told of the decision on Monday.
Iran claims South Korea owes it about $7bn in oil export revenue, with Foreign Minister Javad Zarif saying this week that other cash deposits could bring the total to as much as $10bn.
The funds were frozen after former US president Donald Trump pulled out of the 2015 nuclear deal between Tehran and world powers, and reimposed sanctions.
The South Korean foreign ministry said the US would be consulted on the process of unfreezing the funds.
"The actual unfreezing of the assets will be carried out through consultations with related countries, including the United States," the ministry said.
The funds are likely to be used to pay bills outside Iran in line with US sanctions exemptions, said Esfandyar Batmanghelidj, analyst and founder of commentary site Bourse and Bazaar.
"Iran has indicated three possible uses for initial tranches of released funds so far: medical devices, Covid-19 vaccines, payment of UN dues," Mr Batmanghelidj told The National.
"Reports suggest that South Korea would be converting Iran's reserves into Swiss francs before a transfer to Iranian accounts in Switzerland, a country from which Iran purchases a significant volume of pharmaceutical products and medical devices each year, but with which Iran runs a huge trade deficit."
Tehran said it would still take legal action against Korean banks that showed a "lack of co-operation" on the issue.
Iranian President Hassan Rouhani praised the deal and others with nations such as Oman and Japan as proof that the Trump administration's maximum-pressure campaign of sanctions had not borne fruit.
"The futility of sanctions on Iran is becoming clearer," Iran's news agency Tasnim reported Mr Rouhani as saying.
"The Iranian people’s maximum resistance against the full-blown economic war imposed by the enemy is yielding results."
News of the agreement led to speculation that it could form part of a hostage exchange between the US and Iran.
South Korea itself is still negotiating the release of a ship captured by Iran in January, which the Revolutionary Guard said had been seized for polluting the Arabian Gulf.
This month, Iran promised to release 19 crew members from the Hankuk Chemi oil tanker.
"The Hankuk Chemi incident created new urgency around the resolution of this dispute between Iran and South Korea, and marked a low in bilateral relations that had been very positive and trusting for many years," Mr Batmanghelidj said.
But he said relations were heading in the right direction before the seizure of the boat, so it was unlikely the incident led to Tuesday's breakthrough.
The captain is on board the ship, which is in Iranian custody. Iran has denied any link between the ship's seizure and the funding problem.