WASHINGTON — The Senate passed legislation Tuesday that would allow families of Sept. 11 victims to sue the government of Saudi Arabia, rejecting the fierce objections of a U.S. ally and setting Congress on a collision course with the Obama administration.

The Justice Against Sponsors of Terrorism Act, approved by voice vote, had triggered a threat from Riyadh to pull billions of dollars from the U.S. economy if the bill is enacted.

The legislation, sponsored by Sens. John Cornyn, R-Texas, and Chuck Schumer, D-N.Y., gives victims’ families the right to sue in U.S. court for any role that elements of the Saudi government may have played in the 2001 attacks that killed thousands in New York, the Washington, D.C., area and Pennsylvania.

The House still must act on the legislation.

Relatives of Sept. 11 victims have urged the Obama administration to declassify and release U.S. intelligence that allegedly discusses possible Saudi involvement in the attacks.

Saudi Foreign Minister Adel bin Ahmed Al-Jubeir denied earlier this month that the kingdom made any threats over the bill. He said Riyadh had warned investor confidence in the U.S. would shrink if the bill became law.

“In fact what they (Congress) are doing is stripping the principle of sovereign immunities, which would turn the world for international law into the law of the jungle,” Al-Jubeir said in a May 3 statement.

The Treasury Department said Monday that Saudi Arabia in March held $116.8 billion in Treasury debt.

Passage of the bill sends the message that the United States “will combat terrorism with every tool we have available, and that the victims of terrorist attacks in our country should have every means at their disposal to seek justice,” Cornyn said.

Schumer said that any foreign government that aids terrorists who strike the U.S. “will pay a price if it is proven they have done so.”

Senate Democrats had firmly supported the legislation, putting them at odds with the Obama administration.

The White House has said the bill could expose Americans overseas to legal risks, and spokesman Josh Earnest said Tuesday efforts to revise the legislation fell short in addressing the administration’s concerns.