WASHINGTON, Sept 28 (Reuters) - The U.S. Congress on Wednesday overwhelmingly rejected President Barack Obama's veto of legislation allowing relatives of the victims of the Sept. 11 attacks to sue Saudi Arabia, the first veto override of his eight-year presidency.
The House of Representatives voted 348-76 against the veto, just hours after the Senate rejected it 97-1, meaning the "Justice Against Sponsors of Terrorism Act" will become law.
The vote was a blow to Obama and to Saudi Arabia, one of the United States' longest-standing allies in the Arab world.
Obama's 11 previous vetoes were all sustained. But this time almost all of his strongest supporters in Congress opposed him in one of their last actions before leaving Washington to campaign for the Nov. 8 election.
"Overriding a presidential veto is something we don't take lightly, but it was important in this case that the families of the victims of 9/11 be allowed to pursue justice, even if that pursuit causes some diplomatic discomforts," Senator Charles Schumer, the third-ranking Democrat in the Senate, said in a statement.
Learn more about the children of the 9/11 victims:
The children of September 11 victims
The children of September 11 victims
Alicia Bergstein (C) comforts her children Devin Bergstein, left, and Adrianna Bergstein while visiting the National 9/11 Memorial during the tenth anniversary ceremonies of the September 11, 2001 terrorist attacks at the World Trade Center site, September 11, 2011 in New York City. Daniel Bergstein, Alicia husband and the childrens' father, was killed on 9/11.(Photo by Seth Wenig-Pool/Getty Images)
Kimberly Ramsaroop, 10, left, and Tiffany Ramsaroop, 18, right, lost their father, Vishnoo Ramsaroop in the Sept. 11, 2001 attack on the World Trade Center. He was a maintenance worker at the World Trade Center. They live with their mother Sita Ramsaroop in Jackson Heights, New York. The family was given a flag of many of those who died on 9/11, including their father, which hangs in one of the family bedrooms. Vishnoop had several other children, including Ashley Ramsaroop, now 15, (not shown). (Photo by Carolyn Cole/Los Angeles Times via Getty Images)
Teresa Cunningham (R) with her son Liam (L) photographed at Michael Cunningham's grave stone on August 19, 2011 in Princeton Junction, New Jersey. Just 13 days after he was born little Liam Cunningham's British dad was killed in the 9/11 attacks. A decade on and Liam has just celebrated his 10th birthday - less than two weeks before today's 10-year anniversary of the terrorist atrocity that shook the world. Even though Liam has no memories of his father, he said: 'Daddy will always be my hero. But I wish I could talk to him sometimes. We never even knew each other.' Mum Teresa, 45, still lives with the pain of missing two calls her beloved husband made after the first plane struck the North Tower of the Word Trade Centre in New York. She didn't turn on the family's TV for three months after watching the horror unfold from her living room in picturesque Princeton Junction, New Jersey. Brit Michael, a West Ham United fan from Illford, Essex, worked on a trading desk for firm Euro Brokers - high on the 83rd floor of the South Tower. Tragically he returned to work from his paternity leave a few days early after Liam's birth because the busy company needed him. When US Navy Seals killed Osama Bin Laden in May, Teresa tried to explain things to only child Liam in a way he would understand. She said it was the first time he understood that a person was responsible for his father's death. (Photo by Laurentiu Garofeanu / Barcroft U / Getty Images)
Madeline Bergin with her children, Shannon, 16 (far left), John Jr., 19 , and Katie, 21, (middle), are photographed in front of a street sign near their Staten Island home on July 9, 2011. This street sign honors her firefighter husband, John Bergin. Bergin was one of eleven firefighters from the Rescue 5 firehouse of Staten Island killed at the World Trade Center on September 11, 2001. Ten years after 9/11 Madeline recalled in the summer of 2011, 'The past 10 years have been a roller coaster. A lot of ups and downs and we made a lot of progress. My children are doing 100% better than they were back then. I guess all of us are, but for us it will never really be over. It's an ongoing struggle, an ongoing battle. It's always there.' (Photo by Gary Friedman/Los Angeles Times via Getty Images)
Michelle Haskett-Godbee with her children Imini, 11, and Kai, 8, who lost their father during the terrorist attacks on 9/11, stand during the 7th annual 9/11 memorial ceremony at Zuccotti Park September 11, 2008 in New York City. Family and friends of the victims, heads of government and others gathered at the annual ceremony to remember the attacks that killed more than 2,700 people with the destruction of the World Trade Center on September 11, 2001. (Photo by Timothy A. Clary-Pool/Getty Images)
Ashley Fodor, daughter of firefighter Edward Kilduff who died on September 11, 2001, speaks during a memorial ceremony to honor New York firefighters that were killed in the attacks on the World Trade Center at St Patrick's Cathedral on September 10, 2011 in New York City. 343 firefighters were killed in the 9/11 attacks. New York City and the nation are preparing for the 10th anniversary of the terrorist attacks on lower Manhattan which resulted in the deaths of 2,753 people at the World Trade Center. (Photo by Brian Snyder-Pool/Getty Images)
Jonathan Santos, 9, left, holds a "Choodle," a breed of Chihuahua combined with poodle, as he talks with Bill Berloni, Thursday, April 27, 2006, on the roof of the Humane Society of New York, during "Take Your Sons and Daughters to Work Day." Santos is a member of Tuesday's Child, a group for children who lost parents in the Sept. 11th attacks. The group had several programs for children left without a parent in the wake of the terroritst attacks. (AP Photo/Kathy Willens)
Nine-year-old August Larsen makes a crayon rubbing of his father's name where it appears on the bronze plaques that surround the edges of the 9/11 Memorial pool during the tenth anniversary ceremonies of the September 11, 2001 terrorist attacks at the World Trade Center site, September 11, 2011 in New York City. (Photo by Chip Somodevilla/Getty Images)
Julie Jalbert-Pitt (L) who lost her father, Robert Jalbert on 9/11, holds her daughter Campbell Pitt, 8 months, next to the name of her father during tenth anniversary ceremonies of the September 11, 2001 terrorist attacks at the World Trade Center site September 11, 2011 in New York City. (Photo by Carolyn Cole-Pool/Getty Images)
Stephanie Holland, right, lost her mother Cora on 9/11. She and her children, Amelia Brodney, 10, and Drew Brodney,12, came to the Garden of Remembrance memorial at the Public Garden to re-etch the name of Stephanie's mother. (Photo by Suzanne Kreiter/The Boston Globe via Getty Images)
The Roy siblings in a spontaneous hug with a staffer, left. Timmy, 13, Brittney, 17, and Caitlin, in rear. The three are from New York and have been coming to camp since losing their dad, a New York City police officer, on Sept. 11. Now the older two girls work as counselors. Hugs and support are common for campers at America's camp, a week long camp for children whose parents died in 9/11, in its tenth and final year. (Photo by Joanne Rathe/The Boston Globe via Getty Images)
13-year-old Peter Negron, who lost his father Peter Negron in the terrorist attacks, reads the Poem 'Stars' during the WTC Memorial Service at the World Trade Center Site September 11, 2003 in New York City. A commemoration ceremony was held and the names of the nearly 2,800 victims were read by 200 surviving children and family members at ground zero. (Photo by Luiz C. Ribeiro-Pool/Getty Images)
ARLINGTON, MA - SEPTEMBER 8: Teresa Mathai with her son Robert Mathai at their home in Arlington, Mass.,September 8, 2010. Teresa's husband Joseph, Robert's father, was killed Sept. 11, 2001. Cats looking out are Romeo (left) and Hermes. (Photo by John Blanding/The Boston Globe via Getty Images)
SLUG: ME-CHILDREN2 DATE: 8/20/08 CREDIT: BILL O'LEARY / TWP CHEVY CHASE, MD. Thomas Heidenberger II, 21 years old, was just 3 weeks into his freshman year of high school when his mother was killed on September 11, 2001. (Photo by Bill O'Leary/The Washington Post/Getty Images)
Youngest daughter of Emilio 'Pete' Ortiz, a victim of the September 11 2001 attacks on the World Trade Center during the Memorial service at the World Trade Center Site on September 11, 2006 in New York City. (Photo by Jemal Countess/WireImage)
AUGUST 04, 2006 - WICHITA, KS - Renee Riley with her daughter Katie, 8, at their home in Wichita KS. Renee's late husband, Daniel, was killed in the World Trade Center on September 11, 2001. Daniel worked as a computer analyst and was on the 97th of Tower 1 when the plane struck. Renee grew up in Wichita and returned there after 911 saying she feels safe there. She and Daniel were just weeks from moving into the dream house they had built in NJ when he was killed. (STAFF PHOTO BY CRAIG F. WALKER / THE DENVER POST) (303 870 1894) (Photo By Craig F. Walker/The Denver Post via Getty Images)
JERSEY CITY, NJ - NOVEMBER 23: Thelma Stuart of Valley Stream, Long Island plays with her daughter Amanda as they wait to ride in the first PATH train to return to the World Trade Center at Jersey City's Exchange Place station as regular PATH service between the World Trade Center and New Jersey resumes November 23, 2003 in Jersey City, New Jersey. The World Trade Center PATH station was destroyed on September 11, 2001. Stuart's husband, Walwyn Stuart, died September 11 while working as a Port Authority police officer. Stuart evacuated passengers from the Path World Trade Center station then proceeded up to the towers to help evacuate more people when the towers collapsed. (Photo by John O'Boyle-Pool/Getty Images)
Baylor University student Sonia Shah speaks during an interview in Waco, Texas on Aug. 25, 2016. When she thinks about the push and pull of American unity since the attacks that killed her father, Jayesh, at the World Trade Center on Sept. 11, 2001, she pictures a rock hitting a pond. The innermost ripple, that's the tight circle of support that came together around the people most directly affected by tragedy. Outside it, bigger and more diffuse, are bands of debate over policies and politics in the wake of 9/11. (AP Photo/John Mone)
Discover More Like This
BACK TO SLIDE
Schumer represents New York, the site of the World Trade Center and home to many of the nearly 3,000 people killed in the 2001 attacks, attack survivors and families of victims.
He led the fight for the legislation in the Senate, with Senator John Cornyn, the No. 2 Senate Republican. Kirsten Gillibrand, New York's other senator and also a Democrat, cast the 67th "no" vote, the number needed to override the veto in the Senate.
Obama had argued that the bill, known as JASTA, could expose U.S. companies, troops and officials to lawsuits, and alienate important allies at a time of global unrest. He called Senate Minority Leader Harry Reid and wrote a personal letter to him explaining that he strongly believed enacting JASTA into law would be detrimental to U.S. interests. Reid became the only senator to side with Obama.
A White House spokesman slammed the Senate's vote.
"This is the single most embarrassing thing this United States Senate has done possibly since 1983," spokesman Josh Earnest told reporters.
The Saudi government financed an extensive lobbying campaign against the legislation.
Major U.S. corporations including General Electric Co and Dow Chemical Co also opposed it, as did the European Union and other U.S. allies.
Secretary of Defense Ash Carter urged lawmakers to sustain the veto, and in an unusual move, CIA Director John Brennan issued a statement before Wednesday's votes saying the bill had "grave implications" for national security.
Democratic Senator Tim Kaine, Hillary Clinton's vice presidential running mate, and Bernie Sanders, an independent and former Democratic White House contender, did not vote. (Additional reporting by Richard Cowan and Jonathan Landay; Editing by Marguerita Choy and Leslie Adler)