WASHINGTON — Iran’s central bank must pay nearly $2 billion to victims of terrorist attacks, the Supreme Court ruled on Wednesday.

In a 6-to-2 decision, the court said Congress had not exceeded its constitutional role in enacting a statute to make it easier for the plaintiffs to recover damages that had been awarded to them in a series of lawsuits.

The cases were brought by the families of Americans killed in terrorist attacks found to have been sponsored by Iran, including relatives of those who died in the 1983 Marine Corps barracks bombing in Lebanon. That attack killed 241 servicemen.

The plaintiffs sought to collect frozen funds from Bank Markazi, Iran’s central bank, relying on a 2012 federal law, the Iran Threat Reduction and Syria Human Rights Act, that made the task easier by specifying assets of the bank that could satisfy the plaintiffs’ judgments. The law was quite specific, naming a single, pending consolidated case by caption and docket number.