Compensation for American diplomats held hostage for 444 days in Iran more than three decades ago was hailed on Thursday by the former captives and the lawyers who for years fought Tehran and Washington to get a measure of vindication.

A provision buried in a spending bill signed by President Obama last week will give up to $4.4 million to each of the 37 surviving hostages or the estates of 16 others who died in the years since their release. The sum works out to $10,000 for each day of their captivity and will come from a $9 billion penalty paid by the French bank BNP Paribas for violating sanctions against Iran, Cuba, and Sudan.

"Iran is not paying the money, but it's as close as you can get," said Thomas Lankford, an attorney who represented the former hostages and their families in a lengthy battle that continued even after the courts and the U.S. government repeatedly denied their requests for restitution. Lankford called the restitution "gratifying after a long, long time."

The compensation for the hostages held in the U.S. Embassy in Tehran between November 1979 and January 1981 brought some closure to the victims of one of the defining foreign relations crises of the 20th century. It fractured relations between Iran and the United States and ultimately pitted the former hostages not only against the authorities in Tehran, but also against their own government.

They were barred from taking legal action against Iran under the 1981 Algiers Accords, brokered by Algerian diplomats, that led to their release. U.S. Courts, the State Department and presidents all opposed their attempts to sue, citing the deal made in Algiers. So lawyers turned to Congress for help, but even those efforts often failed.

Some hostages said they thought the push to reconsider their claims came after the Iran nuclear deal, which angered many members of Congress, and the Ben Affleck film Argo, a political thriller about the CIA's rescue of six U.S. diplomats in Tehran.

"I think Argo, followed by the Iran nuclear accord, was very instrumental," said Joe Hall, 66, who was an Army chief warrant officer and operations coordinator for the U.S. defense attache at the embassy.

When Lankford told Hall and other hostages in a conference call that the compensation had been enacted, Hall said, "I had the phone on mute and sat in shock for a few minutes. It was an emotional moment, by myself in the woods."

The part of the bill that brought them vindication was introduced by Sen. Johnny Isakson (R., Ga.), chairman of the Senate Veterans Affairs Committee, who counts three former hostages, including Hall, among his constituents. He had introduced compensation legislation for the Iran hostages every year since 2013.

The law, first reported by USA Today and signed by Obama on the day he left for vacation, also authorizes $600,000 for each close relative of a hostage. "The Iran hostages sacrificed mightily for our country, and I'm delighted that these brave men and women and their families are finally getting some semblance of justice," he said in a statement.