The House on Tuesday night failed to approve legislation to extend surveillance authorities in the Patriot Act. 

In a 277-148 vote, the House fell just seven votes short of the two-thirds majority of voting members necessary to move the bill under suspension of the rules.

More than two dozen Republicans bucked their leadership in the vote, by far the biggest defection for the House GOP since it took over the lower chamber. Until tonight's vote, Republicans voted together in all but two votes this year, and in those two votes, only one Republican voted with Democrats.

Republicans voting against the bill were Reps. Justin AmashJustin AmashBipartisan group asks DHS, ICE to halt deportations of Iraqi nationals Overnight Defense: House votes to end US support for Yemen war | Vote expected to force Trump's second veto of presidency | More Russian troops may head to Venezuela | First 'Space Force' hearing set for next week House ignores Trump veto threat, approves bill ending US support for Yemen war MORE (Mich.), Roscoe Bartlett (Md.), Rob BishopRobert (Rob) William BishopStatehood bill could make Puerto Rico a state before 2020 Here's why Congress, not the president, should lead on environmental protection Overnight Energy: McConnell tees up vote on Green New Deal | Centrist Dems pitch alternative to plan | House Republican likens Green New Deal to genocide | Coca-Cola reveals it uses 3M tons of plastic every year MORE (Utah), Paul BrounPaul Collins BrounCalifornia lawmaker's chief of staff resigns after indictment Republican candidates run against ghost of John Boehner The Trail 2016: Let’s have another debate! MORE (Ga.), John Campbell (Calif.), John Duncan (Tenn.), Mike Fitzpatrick (Pa.), Chris Gibson (N.Y.), Tom GravesJohn (Tom) Thomas GravesMnuchin tells Congress it's 'premature' to talk about Trump tax returns decision Live coverage: Barr faces House panel amid questions over Mueller report Overnight Defense: Dem chair rejects Pentagon request to use B for border wall | House fails to override Trump veto | Pelosi at AIPAC vows Israel won't be 'wedge issue' MORE (Ga.), Dean HellerDean Arthur HellerTrump suggests Heller lost reelection bid because he was 'hostile' during 2016 presidential campaign Trump picks ex-oil lobbyist David Bernhardt for Interior secretary Oregon Dem top recipient of 2018 marijuana industry money, study finds MORE (Nev.), Randy Hultgren (Ill.), Tim JohnsonTimothy (Tim) Peter JohnsonSeveral hurt when truck runs into minimum wage protesters in Michigan Senate GOP rejects Trump’s call to go big on gun legislation Court ruling could be game changer for Dems in Nevada MORE (Ill.), Walter Jones (N.C.), Jack Kingston (Ga.), Raul Labrador (Idaho), Connie Mack (Fla.), Kenny Marchant (Texas), Tom McClintock (Calif.), Ron Paul (Texas), Denny Rehberg (Mont.), Phil Roe (Tenn.), Dana Rohrabacher (Calif.), Bobby Schilling (Ill.), David SchweikertDavid SchweikertHouse Ethics Committee extends probe of Arizona GOP lawmaker On The Money: Trump trade chief sees tough work ahead on China | Cohen offers gripping testimony | Tells lawmakers Trump inflated assets | Deduction cap could hit 11 million taxpayers | Senate confirms top IRS lawyer Trump trade chief warns of tough work ahead on China deal MORE (Ariz.), Rob WoodallWilliam (Rob) Robert WoodallLatino group urges state lawmaker to make primary challenge to Democrat for Georgia House seat House Budget Republican says Dems request of Trump tax returns is attempt 'to weaponize' tax code GOP lawmaker predicts a Reagan-like immigration bill will land on Trump's desk MORE (Ga.), and Don YoungDonald (Don) Edwin YoungCongress: Pass legislation that invests in America's water future Bipartisan group introduces legislation to protect federal workers' health benefits during shutdowns Deceptions may sink plans to drill for oil in the Arctic Refuge MORE (Alaska).

Among the Democrats, 67 voted with Republicans, and nearly twice that much, 122, voted against the GOP.

Democrats were gleeful that the bill fell short.

Veteran Democratic Rep. Barney Frank (Mass.) exited the House chamber boasting that the GOP unsuccessfully held the scheduled 15-minute vote open for a total of 35 minutes to twist enough Republican arms to change the outcome.

"They didn't have the votes! They kept trying to get them to switch, but couldn't get them," Frank exclaimed as he walked through reporters in the Speaker's Lobby, which is just off the House floor.

Democratic Rep. Lacy Clay (Mo.) laughed as he told The Hill, "We're so happy, I'm so happy. I voted against it. They tried to get enough Rs to switch their votes, because the Tea Party voted 'no' also... but it wasn't enough."

The bill, H.R. 514, would extend the authority that allows U.S. agents to conduct "roving surveillance" of targets, collect business records and other tangible intelligence records, and surveil solo operators who are not tied to a specific terrorist group but may pose a threat to the United States.

These authorities expire on February 28, which means the House may have to take up the measure quickly under a rule, which would make for a slower process but would also allow it to pass with a simple majority. Clay said he expects Republicans to take this route.

The controversial bill was debated earlier in the way, which allowed several Democrats to voice their opposition. 

Rep. Dennis Kucinich (D-Ohio) was one of the more vocal opponents, and cited a report that said the FBI has conducted thousands of warrantless searches using so-called "national security letters." These letters are a form of subpoena that the FBI and other agencies have used to demand records, and they are not subject to any judicial oversight.

"The Patriot Act is a destructive undermining of the Constitution," Kucinich said. "How about today we take a stand for the Constitution to say that all Americans should be free from unreasonable search and seizure, and to make certain that the attempt to reauthorize the Patriot Act is beat down."

Rep. Jim SensenbrennerFrank (Jim) James SensenbrennerHouse fails to override Trump veto on border wall The 25 Republicans who defied Trump on emergency declaration Hillicon Valley: US threatens to hold intel from Germany over Huawei | GOP senator targets FTC over privacy | Bipartisan bill would beef up 'internet of things' security | Privacy groups seize on suspended NSA program | Tesla makes U-turn MORE (R-Wis.), who sponsored the bill, replied in his own one-minute speech that the Patriot Act did not authorize national security letters, which were instead authorized in a 1986 bill authored by Sen. Pat Leahy (D-Vt.).

Later in the debate, Kucinich said the Patriot Act expanded the list of agencies that are authorized to issue national security letters. But Sensenbrenner again responded by saying the authority for the letters was made permanent in 2006, and that the Patriot Act actually gave recipients of these letters the option of judicial review.

Sensenbrenner today also noted that House Democrats, such as then-House Judiciary Committee Chairman John Conyers Jr. (D-Mich.), supported the extension last year when Democrats were in control of the House. In his closing remarks in the debate, current Chairman Lamar Smith (R-Texas) noted that the Obama administration supports the extension.

The White House actually supports a three-year extension, but said today it would accept the House Republican proposal to extend surveillance authorities until this December.

Molly Hooper contributed to this story.

-- This story was updated at 8:14 p.m.