Updated

As Democrats shouted "shame," seven House Republicans switched their votes and defeated a measure on Thursday meant to protect gay rights.

The vote was 213-212. President Barack Obama has issued an executive order that bars discrimination against LGBT employees by federal contractors, and Rep. Sean Patrick Maloney, D-N.Y., had offered an amendment to a spending bill that would have prohibited using taxpayer dollars to violate the order.

The vote for Maloney's amendment peaked at 217, one short of the majority needed for passage, before it began a slow, sporadic decline. Members of the Republican whip team, whose job is to round up needed votes, were stalking the House chamber's aisles where GOP lawmakers seat, openly pleading for support.

"Need two more votes," Rep. Steve Russell, R-Okla., one of the GOP whips, said loudly as he prowled among Republicans.

Democrats were outraged, loudly chanting, "shame, shame" in the House chamber.

In the end, 29 Republicans joined 183 Democrats backing the measure, but it was not enough.

"This reveals them for who they are. They are bigots. They are haters," said Rep. Steve Israel, D-N.Y.

The No. 2 House Republican, Kevin McCarthy, rejected the suggestion the vote was held open for an inordinate time so Republicans could switch their vote.