It does look fishy as all get out: $400 million in assorted denominations, stacked on wooden pallets and flown to Tehran in the dead of night by the government of the United States. Hours later, five imprisoned Americans are released and board planes to freedom. If that situation—which took place in January—doesn’t look like a hostage deal, what does?

Answer: The actual hostage deal that in fact accounts for the cash payment, which President Obama said on Thursday was not a ransom.

The currency shipped to Iran in the dead of night drew attention from presidential candidate Donald Trump this week, who on Friday appeared to walk back an earlier assertion that he had seen a payment being delivered. But that money was owed to the Islamic Republic since 1979, the year the U.S. froze all the Iranian funds in American banks as retribution for seizure of the U.S. embassy in Tehran, as revolution swept that nation.

What was universally known as the Iran hostage crisis went on for more than a year, and finally ended with a bargain: In exchange for the release of 52 American diplomats and citizens, both sides agreed to resolve the question of money through international arbitration. The Iran-United States Claims Tribunal has trudged along for almost four decades now, and the money has flowed both ways. By 1983, Iran had returned $896 million to U.S. banks, which in turn had returned hundreds of millions in frozen funds to Iran. Today, private claims from the U.S. side have been resolved to the tune of $2.1 billion.

But still at issue as Obama began his second term was $400 million that Iran in the late 1970s had paid for U.S. fighter jets, while Tehran was still a U.S. ally. After it turned into an enemy in 1979, Washington was not about to deliver the jets. But, all these years later, Iran wanted its money back—and with interest.

Get your history fix in one place: sign up for the weekly TIME History newsletter

All told, Tehran was asking The Hague arbitrators (comprising equal numbers of U.S., Iranian and neutral judges) for $10 billion. Fearing they might actually be awarded that much, or something like it, the Obama administration negotiated privately with Tehran, which agreed to settle for $1.7 billion. The $400 million stacked on pallets was the first installment.

The day it arrived, however, a great deal else was going on. January 17 was the day the international compact rolling back Iran’s nuclear program was set to take formal effect. It was also the day that Iran had, privately, agreed to release five Americans it had imprisoned on spurious charges. At the same time, the Obama administration would release seven Iranians the U.S. had held for violating sanctions—the same sanctions that had brought Iran to the negotiating table, and indeed had necessitated doing business in cash, Iran’s banks having been cut off from the international banking system.

There were a lot of moving parts and fraying nerves at the time—and the whole teetering contraption nearly came crashing down when a couple of U.S. Navy river boats strayed into Iranian waters, and were taken by the Revolutionary Guards five days before the big day. To those who follow U.S.-Iranian relations, the swiftness of the sailors’ release—the very next day—was the most impressive indication of how badly both sides wanted January 17 to come off as planned.

At least till now.

The pallets of Euros and Swiss francs are even more vivid a symbol. To Iran-watchers, they show how badly Obama’s team wanted to bolster Iran’s moderate leaders, who had promised their public that the nuclear deal would produce immediate economic improvements. It also helps to bear in mind that Iran’s theocratic government works on a patronage system. When Mahmoud Ahmadinejad was president, it was his loyalists who got the contracts to smuggle Iran’s oil past the sanctions; President Hassan Rouhani is now grappling with the fallout from paying his own people tens of thousands a month. In short, cash and a show of good will were much in demand.

Were the prisoners a factor? Even on Jan. 17, when the apparent quid pro quo was Obama’s grant of clemency to the seven Iranians, the concept of hostage-taking haunts every transaction with Iran.

The mullahs insisted that Jimmy Carter have left office before releasing the 52 original hostages, minutes after Ronald Reagan was sworn in Jan. 21, 1981. The “arms for hostages” scandal that marred Reagan’s second term brought together Iran, Central American insurgencies and U.S. prisoners held by Iranian surrogates.

Nor was President Obama the first president to look for leverage in The Hague. A flurry of claims settlements in 1989 came as President George H.W. Bush attempted to persuade Tehran to help release more American hostages, a group that was being held in Lebanon. “I’d like to get this underbrush cleaned out now,” Bush said, after the U.S. announced it was releasing $567 million in frozen assets to Tehran. “I hope,” Bush added, “they will do what they can to influence those who hold these hostages.”

At the time, a State Department official quoted in TIME acknowledged what amounted to a dance: “You want to do things that are justifiable on their own merits and defensible in terms of U.S. interests. And if Iran wants to take it as a signal, fine.” And, if not dandy, at least the way things seem to work with Iran.

Get our History Newsletter. Put today's news in context and see highlights from the archives. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.