Shouts erupted in the House gallery Thursday morning after several Republican members switched their votes, defeating an amendment that would have preserved anti-discrimination protections for LGBT employees of federal contractors.

The procedural maneuvering is a little complicated but here’s the gist: Late Wednesday, the House had passed defense legislation which included language that undermines an executive order from President Obama that prohibited federal contractors from discriminating against LGBT people. Rep. Sean Maloney (D-NY) then offered an amendment that would have reversed the anti-LGBT provision in the defense bill.

That’s when things got interesting.

Initially, it looked like Maloney’s amendment would pass in a Thursday morning vote. At the end of the two minutes allotted to members for casting votes, there were 217 votes in favor of the amendment, with 206 votes against.

But Republicans held the vote open for about another five minutes, and slowly a handful of the “yea” votes from Republicans switched to “nea.”

As the vote remained open, shouts of “Regular order!” could be heard on the House floor. And as Republicans came closer to defeating the bill, people began chanting, “Shame! Shame! Shame!”

Shortly after there were enough votes to defeat the amendment, the voting was closed, and the amendment ultimately failed 213-212.

After the vote, House Minority Whip Steny Hoyer (D-MD) protested the move by House Republicans. He questioned how the vote remained open and votes were changed without members walking up to the desk to switch their vote.

“I saw no one come to the desk to change their vote,” he said on the House floor. “Not one of those members — who apparently changed their vote because it kept changing on the board — came to this well and had the courage to change from green to red, or red to green. How is that possible?”

When asked about Republican members switching their votes, House Speaker Paul Ryan (R-WI) told reporters he didn’t know anything about it.

“I don’t know the answer. I don’t even know,” he said, according to The Hill.

Hoyer alleged that the Republicans who changed their vote initially believed that the amendment would fail.

“Several Republican Members initially cast votes in favor of Rep. Maloney’s amendment but shamefully changed their votes after it was clear the amendment would pass, leading the amendment to fail by just a single vote,” Hoyer said in a Thursday afternoon statement. “Not only did they vote against equality and inclusion, but those who switched their votes did not even have the courage to do so openly in the well of the House. They did so quietly from the back benches, contrary to established practice that requires vote-switching to be done in person at the Clerk’s desk, and House Republican leaders held a two-minute vote open for nearly eight minutes.”

Maloney and other House Democrats quickly called out Republicans for holding the vote open to defeat protections for LGBT people.

“In the past day, House Republicans have gone out of their way to rig votes and block bills that prevent discrimination against LGBT people,” Maloney said in a statement after his amendment failed. “When they break their our own rules to make sure taxpayer dollars can go to folks who discriminate, they showed who they truly are – bigots and cowards.”

My colleagues just voted to support discrimination – they are hateful. SHAME. — Sean Patrick Maloney (@RepSeanMaloney) May 19, 2016

GOP leadership held the vote up until they convinced GOP colleagues to CHANGE their vote- disgraceful decision. SHAME — Sean Patrick Maloney (@RepSeanMaloney) May 19, 2016

I’m very disappointed by this floor session. @RepSeanMaloney, you had the votes, your amendment deserved to pass. — Kyrsten Sinema (@RepSinema) May 19, 2016

Disappointed so many @HouseGOP reps changed their vote at last minute to defeat @RepSeanMaloney #LGBT anti-discrimination amendment. — Paul Tonko (@RepPaulTonko) May 19, 2016

Hoyer later revealed on Twitter the seven Republican members who changed their vote on the amendment: Rep. Jeff Denham (R-CA), Rep. Greg Walden (R-OR), Rep. Mimi Walters (R-CA), Rep. David Young (R-IA), Rep. Darrell Issa (R-CA), Rep. Bruce Poliquin (R-ME), and Rep. David Valadao (R-CA).