The White House's top spokesman said a $400 million cash payment to Iran as part of the nuclear deal, details that were revealed in a new report Tuesday, actually saved Americans billions of dollars and those calling it ransom for hostages are "flailing" to justify their continued opposition to the agreement.

"Listen, you guys know the facts here, but for those who are flailing to justify their continued opposition to preventing Iran from obtaining a nuclear weapon…," White House press secretary Josh Earnest said before launching into an explanation of the payment.

Earnest said the $400 million was money that the Iranians paid into a U.S. bank account in 1979 as part of a transaction to produce military equipment. That military equipment was never provided, he said, because the shah of Iran was overthrown.

"It was hard for the U.S. to make an argument in this case that we could just keep the money — so what the U.S. did was resolve a longstanding claim at the Hague that saved American people potentially billions of dollars as it relates to the details," he said.

Republican critics of the deal immediately seized on the report of the $400 million payment, which was air-lifted to Iran the same day as American hostages were released, as evidence that it amounted to a ransom payment.

Republican presidential nominee Donald Trump early Tuesday morning tweeted that Democratic presidential candidate Hillary Clinton was responsible for starting the early talks with Iraq on the nuclear deal so she bears at least part of the blame for the cash payment.

"Our incompetent Secretary of State Hillary Clinton was the one who started talks to give 400 million, in cash, to Iran. Scandal!" he tweeted.

Earnest said Trump's comments, as well those of other critics, are "an indication of just how badly opponents of the Iran deal are struggling to justify their opposition to a successful deal that has prevented Iran from developing nuclear weapons."