WASHINGTON — The Supreme Court on Tuesday rejected the last legal appeal for former American hostages seeking compensation for their captivity in Iran three decades ago, leaving legislation newly introduced in Congress as the last chance to resolve their longstanding grievance.

A lower court, acting at the request of the State Department, previously blocked the hostages’ effort to win compensation from Iran, holding that the agreement under which they were released barred such claims. The former hostages had sued under a 1996 law that they argued allowed them to seek damages, and in August 2001 they won a judgment of liability, because Iran did not appear in court to defend itself. But the State Department argued that its ability to conduct foreign policy would be compromised if damages were awarded.

The Supreme Court, as is its custom, did not give a reason for its decision on Tuesday.

Fifty-two Americans were held hostage for 444 days after Iranian radicals seized the American Embassy in Tehran in 1979.