Donovan Slack, and Brian J. Tumulty

USA TODAY

WASHINGTON — The House and Senate voted Wednesday to reject President Obama's veto of legislation allowing lawsuits against foreign sponsors of terrorism — the first successful override of a presidential veto since Obama took office.

The president had vetoed the legislation Friday because he said the bill — known as the Justice Against Sponsors of Terrorism Act, or JASTA — would infringe on the president’s ability to conduct foreign policy. It was the 12th veto of his presidency.

Why Obama doesn't want 9/11 families suing Saudi Arabia

But after an intense push by 9/11 survivors and families of victims who want to sue Saudi Arabia based on claims the country played a role in the 2001 terror attacks, even Obama’s Democratic allies on Capitol Hill voted to override his veto.

The House voted 348-77, well above the two-thirds majority needed. The final vote tally in the Senate was 97-1. Minority Leader Harry Reid, D-Nev., cast the lone dissenting vote.

"In our polarized politics of today, this is pretty much close to a miraculous occurrence," Sen. John Cornyn, R-Texas, said. Democrats and Republicans in both chambers agreed, he said, that the bill "gives the victims of the terrorist attack on our own soil an opportunity to seek the justice they deserve."

The top Democrat on the Senate Foreign Relations Committee said he shared some of Obama's concerns but said the victims' rights outweighed them.

"We cannot in good conscience close the courthouse door to those families who have suffered unimaginable losses," Sen. Ben Cardin, D-Md., said.

Obama told CNN on Wednesday that he thinks overriding his veto was a "mistake" and "basically a political vote." But he said he understood why Congress voted the way it did, despite what he suggested were private misgivings among some lawmakers.

“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," he said. "But it would have been the right thing to do."

White House Press Secretary Josh Earnest decried the override as the "single most embarrassing thing the United States Senate has done possibly since 1983."

"Ultimately these senators are going to have to answer their own conscience and their constituents as they account for their actions today," he said, adding that Reid showed "courage" in opposing it.

The measure essentially creates an exception to sovereign immunity, the doctrine that holds one country can’t be sued in another country’s courts. It allows plaintiffs to sue other nations in U.S. federal courts for monetary damages in cases of injury, death or property damage caused by acts of international terrorism in the United States.

The White House has argued that the legislation will prompt other nations to retaliate, stripping the immunity the United States enjoys in other parts of the world. Obama said in a letter to Reid before Wednesday's vote that lawsuits already are allowed against countries designated as state sponsors of terrorism by the U.S. government.

The president warned the law could be "devastating" to the U.S. military, diplomatic and intelligence communities.

"The United States relies on principles of immunity to prevent foreign litigants and foreign courts from second-guessing our counter-terrorism operations and other actions that we take every day," he wrote.

Former ambassador to the United Nations John Bolton and former U.S. Attorney Michael Mukasey, both of whom served under President George W. Bush, have echoed similar concerns in recent weeks.

“An errant drone strike that kills non-combatants in Afghanistan could easily trigger lawsuits demanding that U.S. military or intelligence personnel be hauled into foreign courts,” Bolton and Mukasey wrote in a Wall Street Journal op-ed earlier this month.

But proponents of the law maintain that it is narrowly tailored, and some lawmakers who said they still had doubts before Wednesday's vote said they would monitor any possible fallout and pass new legislation fixing any problems that arise.

Two dozen 9/11 families gathered in the Senate and House public galleries Wednesday to watch the override votes.

“This is what we have been fighting for over a decade,’’ said Terry Strada, national chairwoman of the 9/11 Families & Survivors United for Justice Against Terrorism.

The legislation provides the green light to several lawsuits — consolidated into one case on behalf of 9/11 victims and several insurance companies — as lawyers attempt to prove Saudi government involvement in the terrorist plot. Fifteen of the 19 hijackers who flew planes into the World Trade Center, Pentagon and a Pennsylvania field on 9/11 were Saudi nationals.

The 9/11 commission did not find any proof of Saudi government involvement, but the families still want to examine any possible links not yet uncovered.

“I don’t think anybody should ever have any immunity for what happened on 9/11," said Lorie Van Auken, whose husband worked for Cantor Fitzgerald and died in the attack on the World Trade Center. "It’s about justice. It’s about where this will lead us. It’s not about money."

In his unusual three-page veto message to Congress last week, Obama said he has "deep sympathy" for the families of victims of terrorism.

"I recognize that there is nothing that could ever erase the grief the 9/11 families have endured," Obama wrote. "Enacting JASTA into law, however, would neither protect Americans from terrorist attacks nor improve the effectiveness of our response to such attacks."

Contributing: Gregory Korte

House approves bill letting 9/11 families sue Saudis