Congress voted overwhelmingly Wednesday to allow families of Sept. 11 victims to sue Saudi Arabia for its alleged backing of the attackers, handing Barack Obama the first veto override of his presidency.

Both the House and Senate voted decisively to reverse Obama’s decision to scuttle the legislation. Democrats in both chambers abandoned the president in large numbers despite warnings from Obama and top national security officials that flaws in the bill could put U.S. interests, troops, and intelligence personnel at risk.