Saudi Arabia has warned of dire consequences as United States passes a controversial law, Justice Against Sponsors of Terrorism Act (JASTA) which allows relatives of 9/11 terror attack victims to sue the Saudi kingdom. 

The US congress on Wednesday voted overwhelmingly in favour of the JASTA despite President Barack Obama's disagreement. The law is likely to jeopardise the bilateral ties between the two countries and might also put America's troops and interests at risk. 

Underlining the consequences of the bill, Obama said it would undermine the principle of sovereign immunity, opening up the US to private lawsuits over its military missions abroad. Also, House Speaker Paul Ryan said the Senate might have to "fix" the legislation to protect US troops in particular.

JASTA allows relatives of terrorism victims to pursue cases against foreign governments in US federal court and to demand compensation if such governments are proven to bear some responsibility for attacks on US soil.

The Saudi Government condemned its passage calling the enactment of such act, "a matter of great concern" which may provoke unintended repercussions. "The erosion of sovereign immunity will have a negative impact on all nations, including the United States," the Saudi foreign ministry said in a statement, which was carried on state news agency SPA on Thursday.

A Saudi foreign ministry source called on the US Senate "to take the necessary measures to counter the disastrous and dangerous consequences" of the law.

Saudi Arabia is one of America's longest-standing and most important allies in the Middle East and part of a U.S.-led coalition fighting Islamic State militants in Iraq and Syria.

Families of 9/11 victims have campaigned for the law - convinced that the Saudi Government had a hand in the attacks that killed almost 3,000 people.

However, Riyadh denies having any role in the 9/11 terror attacks in which fifteen Saudi nationals were allegedly involved.