A shipment of $400 million in cash to Iran in January was “contingent” on the release of four imprisoned Americans, the US State Department said Thursday, addressing accusations that it was a “ransom” payment.

Wooden pallets stacked with $400 million worth of euros and Swiss francs were flown into Iran on January 17, the same day the US exchanged seven Iranian prisoners for four Americans, the Wall Street Journal reported earlier this month.

State Department spokesman John Kirby said that the US took advantage of the July 2015 nuclear deal to bundle the talks about releasing the prisoners with the settlement over the frozen Iranian funds.

“I don’t think that anybody in the administration is going to make any apology for taking advantage of these opportunities,”he told reporters at a press briefing on Thursday.

The cash delivery was “contingent” on Iran’s willingness to release the Americans, Kirby said. To “retain maximum leverage” over Iran, the US withheld the payment until the Americans had left Tehran.

BREAKING: State Dept. says $400 million cash payment to Iran was contingent on American prisoners' release. — The Associated Press (@AP) August 18, 2016

Two weeks ago, however, Kirby was saying that the cash transfer was entirely separate from the prisoner swap.

"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,” he was quoted as saying by the Journal.

The cash delivery was the first installment of the $1.7 billion the US was obligated to pay Iran under an international settlement. That is the sum, with interest, held frozen by Washington since 1979, when the pro-US government of Shah Mohammed Reza Pahlavi was overthrown in the Islamic revolution. The funds had been deposited in the US to pay for a shipment of American fighter jets, which never went through.

READ MORE: US 'secretly shipped' $400mn to Iran before release of 4 hostages – report

None of the funds were in US dollars, as such transactions are still illegal under US law. Instead, the euros and francs were procured from the Dutch and Swiss central banks, the Wall Street Journal reported.