Barack Obama. Astrid Riecken/Getty Images White House Press Secretary Josh Earnest on Wednesday called the Senate's override vote on legislation that would allow the families of 9/11 victims to sue Saudi Arabia the "most embarrassing thing" the legislative body has done in decades.

It's "the single most embarrassing thing the United States Senate has done possibly since 1983," he told reporters after news broke of the Senate's 97-to-1 vote.

Earnest was answering a question about the size of the override, which was the largest margin since the Senate voted 95 to 0 in 1983 to override a veto by former President Ronald Reagan.

The House overturned the veto later Wednesday afternoon, which put the measure into law.

"I look forward to the opportunity for Congress to override the president's veto, provide these families with the chance to seek the justice they deserve, and send a clear message that we will not tolerate those who finance terrorism in the United States," Senate Majority Whip John Cornyn of Texas said in a statement Friday after President Barack Obama vetoed the bill.

The override marked the first time that Congress overruled one of Obama's vetoes.

"This is a decision I do not take lightly," said Democratic Sen. Chuck Schumer of New York, one of the authors of the legislation. "This bill is near and dear to my heart as a New Yorker because it would allow the victims of 9/11 to pursue some small measure of justice, finally giving them a legal avenue to pursue foreign sponsors of the terrorist attack that took from them the lives of their loved ones."

The legislation amends a 1976 law that granted other countries immunity from US lawsuits. With the veto overturned, foreign countries could be sued in federal court if they are found to have played any role in terror attacks that killed Americans within the US.

Obama vetoed the legislation because he feared that foreign countries could then take similar actions against Americans overseas, such as members of the military.