(Adds context and details throughout)

RIYADH, Sept 29 (Reuters) - Saudi Arabia's foreign ministry condemned the passage of a U.S. law that would allow families of victims of the Sept. 11, 2001 attacks to sue the kingdom for damages, calling it a matter of "great concern" in a statement on Thursday.

"The erosion of sovereign immunity will have a negative impact on all nations, including the United States," said the statement, which was carried on state news agency SPA after a day of stony silence from Riyadh.

The foreign ministry expressed hope that the U.S. Congress would correct the legislation "to avoid the serious unintended consequences that may ensue," without elaborating on what the consequences might be.

The U.S. Senate and House of Representatives voted overwhelmingly on Wednesday to approve legislation that will allow the families of those killed in the 2001 attacks on the United States to seek damages from the Saudi government.

Riyadh has always dismissed suspicions that it backed the attackers, who killed nearly 3,000 people under the banner of Islamist militant group al-Qaeda. Fifteen out of the 19 hijackers were Saudi nationals.

The Saudi government financed an extensive lobbying campaign against the "Justice Against Sponsors of Terrorism Act", or JASTA, in the run-up to the vote, and warned it would undermine the principle of sovereign immunity.

But Saudi officials who had lobbied against the bill stopped short of threatening any specific retaliation if the law was passed.

The Saudi riyal fell against the U.S. dollar in the forward foreign exchange market on Thursday after the law was passed.

Analysts said a successful lawsuit against the Saudi government would be unlikely at best, but speculated that the uncertainty surrounding the legal implications could negatively affect bilateral trade and investment with a major ally.



(Reporting by Katie Paul; Editing by Diane Craft and Tom Brown) ((Katie.Paul@thomsonreuters.com;))