Families of those killed in the terror attacks on 9/11 are now legally allowed to sue Saudi Arabia, after Congress voted Wednesday to override President Barack Obama's veto of the legislation, the first override of his presidency.

The votes by the House and Senate were overwhelming. Members of both parties broke into applause on the House floor after the vote.

The Senate approved the override on a 97-1 vote, with Senate Minority Leader Harry Reid the lone Senator voting to sustain the president's veto. Hours later, the vote in the House was 348-77, with one Democratic member voting "present."

White House spokesman Josh Earnest said aboard Air Force One before the House had voted that the Senate's override is the "single most embarrassing thing the Senate has done since 1983," referring to the last time the Senate overrode a veto by such a large margin.

The remark immediately infuriated lawmakers and staffers.

"It's amateur hour at the White House," one Democratic aide said.

"Asking us to stand between 9/11 families and their day in court is asking a lot," Democratic Sen. Chris Coons of Delaware said in response.

Obama told CNN's Jake Tapper Wednesday that members of Congress made a "political vote" by voting overwhelmingly to override his veto.

"It's an example of why sometimes you have to do what's hard. And, frankly, I wish Congress here had done what's hard," he said in a CNN town hall. "If you're perceived as voting against 9/11 families right before an election, not surprisingly, that's a hard vote for people to take. But it would have been the right thing to do ... And it was, you know, basically a political vote,"

In the House, New Jersey GOP Rep. Chris Smith urged members to override the President's veto, showing a poster of a New York Daily News edition after Congress initially approved the bill with a picture of Obama standing with the Saudi King and the headline: "Don't choose THEM before U.S."

Smith said, "The President chose the King and he vetoed the bill and we can correct that here today."

Sen. Tim Kaine of Virginia, the Democratic vice presidential candidate, did not vote.

Former New York City Mayor Rudy Giuliani, on behalf of the Donald Trump campaign, said Wednesday that the President's veto an "was an insult to the families of those we lost on 9/11, and I congratulate the Congress for righting that terrible wrong."

He also criticized Kaine, saying, "The failure of Hillary Clinton's running mate, Tim Kaine, who was obviously afraid to show up to work today and stand with these Americans, is a disgrace."

Clinton has said publicly she supported the legislation. Kaine, who is campaigning and fundraising on Wednesday, would have voted to override had he been in attendance, his office said.

The bipartisan vote on the Hill was a rebuke of the President who had argued the Justice for State Sponsors of Terrorism Act (JASTA) -- which for the first time would allow suits in American courts against state sponsors of terrorist attacks inside the US -- could open the US government to lawsuits for the actions of military service members and diplomats.

Obama also warned it could damage America's relationship with Saudi Arabia, a troubled but key Middle East ally, and other allies who might be accused of terrorism.

But the powerful emotional appeal of providing 9/11 families a legal avenue to pursue justice proved too strong and carried the day

"The victims of 9/11 have fought for 15 long years to make sure that those responsible for the senseless murder of thousands of innocent men, women and children, and injuries to thousands others, are held accountable. JASTA becoming law is a tremendous victory toward that effort," said Terry Strada, National Chair of the 9/11 Families & Survivors United for Justice Against Terrorism. "We rejoice in this triumph and look forward to our day in court and a time when we may finally get more answers regarding who was truly behind the attacks,"

The President spoke by phone to Senate Majority Leader Mitch McConnell and Reid this week to urge them to sustain his veto. In a follow up letter Tuesday, Obama said he was "firmly committed" to assisting the 9/11 families but that JASTA was the wrong approach.

"Enacting JASTA into law ... would neither protect Americans from terrorists attacks nor improve the effectiveness of our response to such attacks. Doing so would instead threaten to erode sovereign principles that protect the United States, including our U.S. Armed Forces and other officials, overseas," Obama wrote. "That is why I vetoed the bill and why I believe you should vote to sustain the veto."

CIA Director John Brennan said Wednesday that "all the national security officials of this government recognize how bad this legislation is for our national security interests and how negatively it's going to effect it."

But sponsors of the measure said it was more important to give the 9/11 families their day in court than to worry about the possible fallout with Saudi Arabia, which they argued wouldn't have anything to worry about if it was not connected to the terror plot.

"How can anyone look at the families in the eye and tell them that they shouldn't have the opportunity to seek justice against a foreign government responsible for the death of their loved one?" asked Sen. John Cornyn of Texas, the chief Republican sponsor of the bill. "At the end of the day, this vote is about doing what's right for the American people."

"The bill is near and dear to my heart as a New Yorker because it would allow the victims of the 9/11 to pursue some small measure of justice finally giving them the legal avenue to pursue foreign sponsors of a terrorist act that took the lives of their loved ones," said Sen. Chuck Schumer of New York, the chief Democratic sponsor.

The concerns raised by the White House were echoed by several senior senators who had worked to try to change the legislation before it passed the Senate.

One of those senators, Senate Foreign Relations Committee Chairman Bob Corker, R-Tennessee, said he would watch for possible "blowback" from the law to determine if Congress should rewrite portions of it in the near future. He and other senators wrote a letter to Cornyn and Schumer laying out their concerns.

Despite his misgivings, Corker announced in an emotional speech on the floor he would vote to override the President's veto in order to give the 9/11 families a chance to seek justice.

CNN's Manu Raju, Kevin Liptak and Deirdre Walsh contributed to this report.