DUBAI, UNITED ARAB EMIRATES -- Iran has moved five Iranian-Americans from prison to house arrest in exchange for billions of dollars frozen in South Korea, U.S. and Iranian officials said Thursday, as part of a tentative deal that follows months of heightened tensions between the two countries.

Iranian officials at the United Nations told The Associated Press that the prisoner transfer marked "a significant initial step" in the implementation of the agreement, which is still being negotiated and could eventually lead to the full release of the Americans.

Iran acknowledged that the deal involves US$6 billion to US$7 billion that were frozen as a result of sanctions. Iranian officials said the money would be transferred to Qatar before being sent on to Iran if the agreement goes through.

The final transfer of the money -- and the release of the five detainees -- is expected in the next month or so due to the complicated nature of the financial transactions, officials said.

"My belief is that this is the beginning of the end of their nightmare and the nightmare that their families have experienced," Secretary of State Antony Blinken told a news conference in Washington, adding that more work would be necessary to free the five.

State Department officials spoke to the prisoners on Thursday, he said.

The deal unfolded amid a major American military buildup in the Persian Gulf, with the possibility of U.S. troops boarding and guarding commercial ships in the Strait of Hormuz, through which 20% of all oil shipments pass.

The agreement is bound to open U.S. President Joe Biden to fresh criticism from Republicans and others that his administration is helping to boost the Iranian economy at a time when Iran poses a growing threat to U.S. troops and Mideast allies.

U.S.-based lawyer Jared Genser, who represents one of the prisoners, said the five will likely be held at a hotel under guard. There are "simply no guarantees about what happens from here," he said.

Neda Sharghi, whose brother, Emad Sharghi, is among the prisoners, said in a statement that her family "has faith in the work that President Biden and government officials have undertaken to bring our families home."

Adrienne Watson, a spokesperson for the White House's National Security Council, described the negotiations for the release as "ongoing" and delicate."

"While this is an encouraging step, these U.S. citizens ... should have never been detained in the first place," she said in a statement.

It remains unclear how many Iranian-Americans are held by Tehran, which does not recognize dual citizenship.

The prisoners include Siamak Namazi, who was detained in 2015 and was later sentenced to 10 years in prison on internationally criticized spying charges; Sharghi, a venture capitalist sentenced to 10 years; and Morad Tahbaz, a British-American conservationist of Iranian descent who was arrested in 2018 and also received a 10-year sentence.

The fourth and fifth prisoners were not identified.

Iran, meanwhile, has said it seeks the release of Iranian prisoners held in the U.S.

American officials declined to comment on who or how many Iranian prisoners might be released in a final agreement. But Iranian media in the past identified several prisoners with cases tied to violations of U.S. export laws and restrictions on doing business with Iran.

The alleged violations include the transfer of money through Venezuela and sales of dual-use equipment that the U.S. alleges could be used in Iran's military and nuclear programs. Iran has been enriching uranium and stockpiling it as part of its advancing nuclear program.

The deal hinges on the frozen assets in South Korea. In the dispute over the money, Tehran seized a South Korean oil tanker and threatened further retaliation this month.

"Definitely Iran will not remain silent, and we have many options that could harm the Koreans, and we will certainly use them," said Fadahossein Maleki, a member of the Iranian parliament who sits on its influential national security and foreign policy committee.

Iran and the U.S. have a history of prisoner swaps dating back to the 1979 U.S. Embassy takeover and hostage crisis following the Islamic Revolution. The most recent major exchange between the two countries happened in 2016, when Iran came to a deal with world powers to restrict its nuclear program in return for an easing of sanctions.

Four American captives, including Washington Post journalist Jason Rezaian, flew home from Iran, and several Iranians in the United States won their freedom. That same day, President Barack Obama's administration airlifted US$400 million in cash to Tehran.

Iran has received international criticism over its targeting of people with dual citizenship. The West accuses Iran of using foreign prisoners as bargaining chips, an allegation Tehran rejects.

Negotiations over a major prisoner swap faltered after President Donald Trump unilaterally withdrew America from the nuclear deal in 2018. From the following year on, a series of attacks and ship seizures attributed to Iran have raised tensions.

Biden entered office with hopes of restarting the deal, but diplomatic negotiations on the accord have been stalled for a year.

Though none of the money frozen in South Korea will enter the U.S. financial system on its way to Qatar, the release is being done with American approval and is bound to draw disapproval from the GOP.

Former U.S. Vice President Mike Pence, who is now seeking the Republican presidential nomination, said the proposed deal would provide Iran with money to produce drones for Russia and "fund terrorism."

"China and Russia, who are also holding Americans hostages, now know the price has just gone up," Pence said in an online statement.

The troop buildup may insulate Biden from criticism from Arab nations in the Persian Gulf, which rely on American security guarantees. The U.S. also is negotiating with Saudi Arabia over potentially recognizing Israel diplomatically, a deal that may involve further guarantees about military support against Iran. Riyadh reached a detente with Iran in March after years of tensions.

------

Lee reported from Washington. Associated Press writers Isabel DeBre in Jerusalem and Nasser Karimi in Tehran, Iran, contributed to this report.