US Marine barracks bombing in Beirut
A crane removes the rubble left by the terror attack on the US Marine barracks in Beirut, Lebanon, in 1983 that killed 241 servicemen Reuters/handout

The relatives of US Marines killed in a terror attack on their barracks in Beirut, Lebanon, have a right to compensation paid by Iranian funds currently frozen in the US, the country's Supreme Court has ruled.

The decision concerning nearly $2bn (£1.4bn) in assets is groundbreaking in that it marks the first time Iran will have to pay US victims over past links to terrorism. It comes amid warming relations between the two nations.

The court's six to two ruling affects more than 1,300 relatives of the victims. Some have been fighting for compensation for decades, the Associated Press reported.

In the 1983 attack 241 Marines, 58 French peacekeepers, two civilians and a pair of suicide bombers were killed when two explosive-laden trucks were driven into US and French barracks filled with men. The "Islamic Jihad" group that claimed responsibility was linked to the Iranian government.

Claimants in the case also included families of victims in the 1996 bombing of the Khobar Towers in Saudi Arabia which killed 19 service members, and other attacks that were carried out by groups with links to Iran.

At issue is $1.75bn in bonds plus accumulating interest, which is owned by Iran's central Bank, Markazi, but is held by Citibank in New York. The money, seized by US officials, is currently held in a federal court trust account.

Though victims' families had won court judgments against Iran for the bombing, the country did not come through with payments. In 2012 a federal law instructed Bank Markazi's assets frozen in the US to be turned over to families of the victims.

"We are extremely pleased with the Supreme Court's decision, which will bring long-overdue relief to more than 1,000 victims of Iranian terrorism and their families," Theodore Olson, a former Bush administration Justice Department official who represented the families told the AP.

The decision comes just as Congress is considering a bill to allow the relatives of people killed in the 9/11 tragedy to sue Saudi Arabia for any links to the attack. Fifteen of 19 men involved in the attack were Saudi citizens. The so-called 20th hijacker, Zacarias Moussaoui, had claimed that al-Qaeda received millions of dollars of donations from the Saudi royal family in the 1990s, which Riyadh denies.

The Obama administration supported the families in the Supreme Court case, but is opposed to the proposed new measure, the Justice Against Sponsors of Terrorism Act. Obama landed in Saudi Arabia on 20 April to meet with leaders amid tensions over the measure.