Democrats shouted "shame," but dozens of House Republicans switched their votes and defeated a measure to protect gay rights.
The vote on Thursday was 213-212.
President Barack Obama has issued an executive order that bars discrimination against LGBT employees by federal contractors.
A New York Democrat, Sean Patrick Maloney, offered an amendment to a spending bill that would have prohibited using taxpayer dollars to violate the order.
The measure was headed toward passage, when suddenly dozens of Republicans reversed course to ensure its defeat.
And that led Democrat Steve Israel to say: "This reveals them for who they are. They are bigots. They are haters."
The No. 2 House Republican, Kevin McCarthy, rejects the suggestion the vote was held open for an inordinate time so Republicans could switch their vote.
© Copyright 2024 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.