When the U.S. House on Wednesday flashed a final vote tally for the George Floyd Justice in Policing Act, which would ban chokeholds among other sweeping police policy changes, it was strictly divided along party lines.

But there was one surprise: A single Republican had crossed the aisle to back the measure. Even more shocking was who had cast that vote. Texas Rep. Lance Gooden, a staunchly conservative Trump supporter, seemed an unlikely ally on a bill championed by the left.

Why the change of heart? Gooden quickly jumped on Twitter to explain.

“I accidentally pressed the wrong voting button and realized it too late,” he wrote in a since-deleted tweet. “I have changed the official record to reflect my opposition to the partisan George Floyd Policing Act.”

Gooden’s mishap didn’t affect the fate of the bill, which passed 220 to 112, with two Democrats voting against it. But it was the latest addition to a storied history of distracted or confused lawmakers casting the wrong vote — sometimes with far more consequential results.

In 2012 in North Carolina, conservative legislators were pushing to overturn the Democratic governor’s veto of a bill that would legalize fracking. Democratic state Rep. Becky Carney had spent days lobbying against the veto, but when the time came to vote, she accidentally hit yes — and became the clinching vote.

Carney immediately scrambled to reverse her vote, but under House rules, votes can’t be changed if they would affect the outcome. Thanks solely to her error, fracking was legalized in the state.

“I feel rotten, and I feel tired,” Carney said at the time. “And I feel that mistakes are made constantly when people are tired. And I feel rotten about it, but I take responsibility for my vote.”

The next year, a freshman Democrat in the Montana House made a similarly grievous error. As Democrats pushed a bill to expand Medicaid coverage, Republicans tried a last-ditch tactical maneuver to keep it off the floor, where it was likely to pass. That’s when Rep. Tom Jacobson cast the wrong vote, giving the GOP a surprise win — and keeping roughly 70,000 Montanans from gaining insurance coverage.

More recently, a conservative Maine state senator last year accidentally helped Democrats override the governor’s veto on a measure legalizing sports gambling.

More often, though, accidental votes are laughed off and quickly changed when they wouldn’t alter the outcome, as in 2010 when Senate Majority Leader Harry M. Reid (D-Nev.) repeatedly cast the wrong voice vote against key pieces of the Obamacare legislation he had spent months fighting to pass.

In 2015, California state Rep. Scott Wilk became the first Republican in years to vote yes on a state budget — all because he was distractedly slamming the very same budget proposal on Facebook as he voted.

“My wife is right — I can’t multitask!” Wilk tweeted. “… The perils of social media.”

It’s not clear what led to Gooden’s mistaken vote on Wednesday. The two-term lawmaker from the Dallas area was always unlikely to support the bill, which Democrats championed in response to mass protests against police violence and racial inequality last year after Floyd’s death in police custody in Minneapolis. Gooden was among the House Republicans in January who objected to certifying President Biden’s electoral victories in Pennsylvania and Arizona.

Late on Wednesday, he took to Twitter again to try to clarify that he would never purposefully support the Democratic efforts.

“I have arguably the most conservative/America First voting record in Congress! Of course I wouldn’t support the radical left’s, Anti-Police Act,” he tweeted, along with a photo of his request to change the official House record on his vote.