WASHINGTON — The State Department admitted Thursday that the United States handed over $400 million in cash to Iran only after Tehran released four American hostages — two weeks after President Obama insisted the payment was not a “ransom.”

State Department spokesman John Kirby was asked at a press briefing: “In basic English, you’re saying you wouldn’t give them $400 million in cash until the prisoners were released, correct?”

“That’s correct,” he replied.

In an Aug. 4 press conference, Obama said the opposite.

“We do not pay ransom. We didn’t here, and we won’t in the future,” the president told reporters, speaking of the January payment and hostage release.

Families “know we have a policy that we don’t pay ransom. And the notion that we would somehow start now, in this high-profile way, and announce it to the world, even as we’re looking in the faces of other hostage families whose loved ones are being held hostage, and saying to them we don’t pay ransom, defies logic,” Obama added at the time.

He even lectured the press for daring to raise the issue.

“It’s been interesting to watch this story surface. Some of you may recall, we announced these payments in January. Many months ago. There wasn’t a secret. We announced them to all of you. [Press secretary Josh Earnest] did a briefing on them.

“This wasn’t some nefarious deal,” the president said.

“It wasn’t a secret. We were completely open with everybody about it and it is interesting to me how suddenly this became a story again.”

The US claims the money, delivered in stacks of cash aboard an unmarked cargo plane, was part of a settlement of a longstanding dispute with the Iranian regime over a never-completed arms deal from the 1970s.

Kirby continued to maintain Thursday that “the two negotiations were separate,” referring to the hostage release and the arms deal.

Kirby’s comments came after the Wall Street Journal reported that the plane carrying $400 million crisscrossed the one returning the four Americans.

The paper had earlier reported that senior Justice Department officials had objected to sending the cash at the same time as the hostage release, but their objections were overruled by the State Department.

“People knew what it was going to look like, and there was concern the Iranians probably did consider it a ransom payment,’’ one official told the Journal.

Critics said the president damaged himself by claiming there was no connection between the payment and the hostages.

“I think most of the world believes it is a ransom payment,” Rep. Ted Yoho (R-Fla.) told CNN.

“And the Obama administration, they lost credibility. They drew a red line and said they didn’t [pay ransom]. It is recorded. CNN has tapes of it. Every major network does . . . It looks fishy.”