The money came from a little-known fund administered by the Treasury Department for settling litigation claims. The so-called Judgment Fund is taxpayer money Congress has permanently approved in the event it’s needed, allowing the president to bypass direct congressional approval to make a settlement.
And the Iranian's bragged about using the money to sponsor terrorism to spite the US.