President Obama lost his first veto fight with Congress on Wednesday after Democrats and Republicans in the House and Senate voted overwhelmingly to override his objection to a bill that would allow families of the Americans killed in the Sept. 11, 2001, terrorist attacks to sue the government of Saudi Arabia.

The bipartisan vote came despite lobbying from Obama to uphold his veto. Obama said he objects to the bill because it could damage U.S. relations with Saudi Arabia and could undermine America's own sovereign immunity against lawsuits.

The Senate voted 97-1 to override Obama's veto, and the only "no" vote was from Senate Minority Leader Harry Reid, D-Nev.

The House voted a few hours later and was also able to get the two-thirds vote needed to override Obama's veto, handing Obama his first, and likely his only, veto override in the nearly eight years he's been in office.

The final House vote was 348-77. Democrats voted by a more than two-to-one margin against Obama.

For many lawmakers in both parties, voting to override the veto was not an easy decision, despite powerful sponsors. The bill was authored by Senate Majority Whip John Cornyn, R-Texas, and the No. 3 Democrat, Sen. Charles Schumer, D-N.Y.

But some lawmakers said they shared Obama's objections with the bill, while Democrats had the added burden of voting to override a veto issued by a Democratic president.

In the House, most voted to override Obama's veto despite warnings from some House lawmakers, including Armed Services Committee Chairman Mac Thornberry, R-Texas.

House Speaker Paul Ryan, R-Wis., was also on the fence. Ryan and other lawmakers said they shared President Obama's concern that the legislation would harm U.S. relations with Saudi Arabia and potentially leave the United States vulnerable to lawsuits from foreigners for its actions in other countries.

Ultimately, however, there was just not enough opposition to uphold the veto.

"I believe that the risks of shielding the perpetrators of terrorism from justice are greater than the risks this legislation may pose to America's presence around the world," said Senate Foreign Relations Committee ranking member Ben Cardin, D-Md.

Sen. Bob Corker, R-Tenn., who sent a letter this week signed by other senators worried about the bill, announced just before the vote that he would vote to override the veto nonetheless.

Corker said he made his decision after speaking Tuesday with the husband of a Sept. 11 victim, who said he watched the two planes hit the World Trade Center, where his wife was killed.

"With tremendous reservations and concerns about where this legislation is going to lead us, with tremendous empathy toward the victims who have lived through so much, who have seen loved ones gone, I'm going to support this legislation today," he said.

Just before the vote, Schumer said he did "not take this decision lightly," to override Obama's veto, but said victims of 9/11 families "just want their day in court."

White House spokesman Josh Earnest criticized the Senate vote by saying it was one of the " most embarrassing" moments for the Senate in recent years.