North Carolina Governor Pat McCrory, a Republican, on Wednesday signed a bill that blocks an LGBT protections ordinance approved by Charlotte city leaders.

The ordinance prohibits discrimination based on sexual orientation and gender identity in public accommodations, vehicles for hire and government contracting and was set to take effect on April 1.

Lawmakers called a one-day special session at a cost of $42,000 to respond to the measure.

In announcing that he had signed House Bill 2, McCrory, Charlotte's mayor for 14 years, repeated the claim that the ordinance was needed to protect women and children.

“Ordinance defied common sense, allowing men to use women's bathroom/locker room for instance. That's why I signed bipartisan bill to stop it,” he tweeted.

The bill sailed through the House and Senate, both of which are controlled by Republicans.

Democrats in the Senate refused to vote on the measure, opting instead to hold a press conference as Republicans approved the bill with a 32-0 vote.

House Bill 2 bars any city, town or municipality from enacting a similar measure. The law also makes North Carolina the first state in the nation to prohibit students in public schools from using the bathroom that does not conform to their gender at birth. Similar attempts in South Dakota and Tennessee failed this legislative session.