Tehran (AFP) - Iran is preparing international legal action to recover nearly $2 billion that the US Supreme Court has ordered be paid as compensation to American victims of terror attacks, President Hassan Rouhani said on Tuesday.

"We will soon take the case of the $2 billion to the international court," Rouhani said in a televised speech.

"We will not allow the United States to swallow this money so easily," the president said to a crowd of thousands in the southeastern city of Kerman.

The US Supreme Court ruled on April 20 that Iran must hand nearly $2 billion in frozen central bank assets to the survivors and relatives of those killed in attacks it has been accused of organising.

The attacks include the 1983 bombing of a US Marine barracks in Beirut and the 1996 Khobar Towers bombing in Saudi Arabia.

The Supreme Court ruling affects some 1,000 Americans.

It came despite hopes for better relations between Tehran and Washington, after a landmark nuclear deal last July between Iran and major powers led by the United States.

UN Secretary General Ban Ki-moon has said he is ready to help settle the dispute over the assets, but only if both governments make that request.