The chaotic scene -- accompanied by loud chants of "shame, shame, shame" -- included one Democrat facing off with the second-highest-ranking House Republican, accusations of foul play and a series of insults being traded openly on the House floor.
The clash began over a yearly spending bill to fund military construction projects and the Veterans Administration. Because the bill covers spending on federal contracts, Rep. Sean Patrick Maloney, D-New York, attached what he said was a one-sentence proposal to uphold President Barack Obama's executive order protecting LGBT workers from being fired. The amendment had enough votes to pass but the vote was held open, and several Republicans changed their position just before the vote was officially closed.
"They literally snatched discrimination out of the jaws of equality. We won this vote," a visibly irate Maloney told reporters.
Maloney accused House Majority Leader Kevin McCarthy of "twisting arms." Maloney and other Democrats told CNN that once the vote board showed the measure had 217 votes -- enough to pass with just eight seconds left in the vote -- McCarthy personally approached House GOP members to switch their "yes" votes to "no" as the presiding officer kept the vote open for several minutes past the standard five-minute period.
A senior House Republican leadership aide told CNN that it wasn't just McCarthy -- all the top GOP leaders were working to defeat Maloney's amendment because they were concerned that if passed, it would jeopardize the spending bill.
When Maloney walked over to McCarthy to appeal to him to allow the measure to pass, saying plenty of Republicans backed it, he said McCarthy told him "get on my own side of the aisle." He answered back to the majority leader, "What side am I supposed to stand on to support equality?"
One Republican who witnessed the exchange said Maloney walked over to the GOP side of the chamber and was "taunting Republican members" and had his arms up in the air as he was trying to talk to them about letting his proposal pass.
Roughly a dozen Republicans approached Maloney as the vote was extended and told him they disagreed with their own leadership's tactics to work to defeat the measure.
California Democratic Rep. Mark Takano, who was standing with Maloney, told reporters that Illinois GOP Rep. Bob Dold told the New York Democrat "this is bulls***."
As the scene unfolded, reporters outside the chamber could hear jeers as the gavel came down with a new 212-213 vote tally, defeating the measure. No. 2 House Democrat Steny Hoyer began shouting and calling out Republicans for not following the traditional practice of coming to the well of the House floor to change their votes, saying they instead remained in their seats to avoid being identified.
Afterward, Democrats produced a list of seven House Republicans, including the head of the GOP's campaign arm, Oregon Republican Rep. Greg Walden, who initially backed Maloney's proposal before switching their votes. The other Republicans, according to a floor vote printout by Democratic staff, were Rep. Jeff Denham, R-California, Rep. Darrell Issa, R-California, Rep. Bruce Poliquin, R-Maine, Rep. David Valadao, R-California, Rep. Mimi Walters, R-California, and Rep. David Young, R-Iowa.
Hoyer's staff also tweeted out the list of names, calling their votes "shameful."
CNN has reached out to all seven House Republicans who changed their vote Thursday morning. So far, only Poliquin has responded about why he decided to vote no for the measure after originally registering support for it, defending his vote in a written statement to CNN.
"I am outraged that political opponents or members of the press would claim or insinuate that I cast a vote due to pressure or party politics," Poliquin wrote. "No one controls my vote. I work hard only for the people of Maine's 2nd Congressional District."
Poliquin added, "I abhor discrimination in any form and at any place."
"They are bigots, they are haters," a seething Democratic Rep. Steve Israel said about House Republicans. He then immediately worked to tie House Republicans to Donald Trump, the presumptive GOP presidential nominee, saying Trump "is very proud of House Republicans today."
House Speaker Paul Ryan, who as the speaker doesn't typically vote, was holding his weekly news conference and missed the fracas. When asked about what happened, he told reporters he didn't have any details about who may have changed their votes, but made it clear he opposed the Democrats' proposal.
"The states should do this. The federal government shouldn't stick its nose in this business," Ryan said.
Maloney vowed, "These things are going to be remembered" and told reporters he planned to try to push similar measures on other legislation.
"The people who stood in the schoolhouse door are going to have this hung around their necks for the rest of their careers, and I hope they can live with themselves," Maloney said. "I hope they can look their kids in the eye and sleep OK tonight because what they did is as disgusting as one of the famous episodes in American history where we've seen people stand on the wrong side of the march toward Selma, or stand in the schoolhouse door when someone was trying to get an equal education."