The US Congress voted overwhelmingly to override Barack Obama's veto of a bill allowing 9/11 victims to sue Saudi Arabia, the first such rebuke during his eight-year presidency.
The Senate overrode the veto in a 97-1 vote, followed a short time later by the House of Representatives, which knocked it down with a 348-77 vote.
The rare act of bipartisanship was a blow to Obama, who lobbied hard against the bill, known as the Justice Against Sponsors of Terrorism Act (JASTA).
Obama called Wednesday's vote a "dangerous precedent."
"I understand why it happened," he said on CNN. "Obviously, all of us still carry the scars and trauma of 9/11."
But he said the decision would harm US national interests by undermining the principle of sovereign immunity, opening up the United States to private lawsuits over its military missions abroad.
"Our men and women in uniform around the world could potentially start seeing ourselves subject to reciprocal loss."
Some of the lawmakers who voted for the override didn't know what was in the bill, he said, calling the result "basically a political vote."
White House press secretary Josh Earnest earlier called the Senate vote "the single most embarrassing thing" the legislative body has done in decades.
"Ultimately, these senators are going to have to answer their own conscience and their constituents as they account for their actions today," he told reporters traveling with Obama in Richmond, Virginia.
Coming in Obama's last months in office, the vote shows the White House to be much weakened.
Obama has issued 12 vetoes during his presidency. None have been overridden until now, a rare feat given Republicans' longstanding control of Congress.
His Republican predecessor George W. Bush also issued 12 vetoes, of which four were overridden. The last president to avoid an override was the legendary Democratic congressional dealmaker -- and former senator and congressman -- Lyndon Johnson.