The Obama administration is embroiled in controversy after it emerged it secretly paid $400m in cash to Iran - the money stacked on pallets and flown on an unmarked plane - at the time four American prisoners were released from Tehran.

The government was accused of making the cash-for-hostages deal by tying the payout to the release. But officials said the money was in truth part of an attempt to settle a 40-year debt agreement that also was part of an historic reengagement with Iran.

“As we’ve made clear, the negotiations over the settlement of an outstanding claim…were completely separate from the discussions about returning our American citizens home,” State Department spokesman John Kirby told the Wall Street Journal.

“Not only were the two negotiations separate, they were conducted by different teams on each side, including, in the case of The Hague claims, by technical experts involved in these negotiations for many years.”

The shipment of cash represented the first payment of a $1.7bn debt that Iran, at an international tribunal in The Hague, claimed it was owed over a failed 1979 arms deal signed before the fall of Shah Mohammad Reza Pahlavi.

However, US officials did admit that Iran wanted the cash in exchange for the Americans so Tehran could say it got something out of the detainees’ release, according to the newspaper's report.

Iran nuclear deal, a year on

When President Obama talked about the release on January 17 this year, he said: “With the nuclear deal done, prisoners released, the time was right to resolve this dispute as well.”

US prisoners held by Iran included Saeed Abedini, Nosratollah Khosravi, Amir Hekmati, a former Marine, and Washington Post reporter Jason ­Rezaian.

The money was paid in euros and other currency acquired from the central banks of the Netherlands and Switzerland, since making a transaction with Iran in American dollars remains illegal under US law.

A Republican senator who has been critical of the deal, Tom Cotton of Arkansas, accused Mr Obama of shelling out “a $1.7bn ransom to the ayatollahs for US hostages”.

“This break with long-standing US policy put a price on the head of Americans, and has led Iran to continue its illegal seizures” of Americans, Mr Cotton said.

Former Republican presidential candidate Marco Rubio tweeted a link to the report Tuesday, saying: “Obama administration sent plan[e] load of cash to #Iran as ransom as part of deal on hostages. Just unreal.”

The US has long had a policy against paying ransom for hostages. In 2015, though, the Obama administration relaxed that policy after the seizures of Americans by Isis, saying it would not prosecute captives’ relatives who wished to pay ransoms on their own. The government will even help families communicate with militants.