It was their money.
https://www.brookings.edu/articles/the-united-states-iran-and-1-7-billion-sorting-out-the-details/