North Carolina’s governor on Wednesday signed a controversial bill blocking cities from allowing transgender individuals to use public bathrooms for the sex they identify as – as well as restricting cities from passing nondiscrimination laws more broadly. House Bill 2, the Public Facilities Privacy & Security Act, puts in place a statewide policy that bans individuals from using public bathrooms that do not correspond to their biological sex. The bill also reserves the right to pass nondiscrimination legislation to the state government, saying state laws preempt any local ordinances. Pat McCrory, a Republican, signed the bill Wednesday night and tweeted, “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.” The General Assembly went into special session earlier in the day to push through the legislation, a response to a nondiscrimination ordinance that the city of Charlotte enacted that, among other things, made it possible for transgender individuals to use the public bathroom of the sex they identify as. The move enraged civil liberties groups and Democrats in the state. The bill passed the state House 82-26 and the state Senate 32-0, with Senate Democrats walking out and not voting in protest. “Rather than expand nondiscrimination laws to protect all North Carolinians, the General Assembly instead spent $42,000 to rush through an extreme bill that undoes all local nondiscrimination laws and specifically excludes gay and transgender people from legal protections,” said Sarah Preston, acting executive director of the American Civil Liberties Union of North Carolina. ACLU and other groups criticized the General Assembly for spending the money on a special session to pass the legislation, which they called rushed through and undemocratic. “Legislators have gone out of their way to stigmatize and marginalize transgender North Carolinians by pushing ugly and fundamentally untrue stereotypes that are based on fear and ignorance and not supported by the experiences of more than 200 cities with these protections,” Preston said. Chris Sgro, executive director of Equality NC, also decried the bill in a statement. “Today’s vote at the NCGA represents politics at its worst. Senator Berger and Speaker Moore should be ashamed of misleading their members to vote for the worst anti-LGBT legislation in the nation, which is sweeping beyond comprehension,” Sgro said. “Protections for LGBT people against discrimination are common sense. This special session, where Berger and Moore rammed through hastily-crafted legislation was a farce of public policy.” The bill also got criticized by Caitlyn Jenner, the Olympian and celebrity who was born a man and recently transitioned publicly. “Another day, another time for us to stand together!! Tell @PatMcCroryNC to stop this bill with the link below #NCGA ,” she tweeted. But North Carolina House Speaker Tim Moore defended the bill. “One of the biggest issues was about privacy,” Moore said. “The way the ordinance was written by City Council in Charlotte, it would have allowed a man to go into a bathroom, locker or any changing facility, where women are – even if he was a man. We were concerned. Obviously there is the security risk of a sexual predator, but there is the issue of privacy.” State Rep. Graig Meyer, a Democrat, said the “discriminatory law puts his health and safety at risk.” “When I arrived home tonight, my wife told me that one of her former students visited her at school today. The student told her that he now identifies as a transgender male,” he posted on his Facebook page. “She loves this student. Today’s discriminatory law puts his health and safety at risk. It’s been a long time since I cried myself to sleep.” Charlotte Mayor Jennifer Roberts, a Democrat, released a statement saying she was appalled by the bill’s passage. “This legislation is literally the most anti-LGBT legislation in the country,” she said Wednesday.U.S. Rep. David Price, D-North Carolina, also chastised the Legislature for prioritizing passing the bill over other issues. “The #NCGA won’t hold a special session to raise teacher salaries, but they will come back to legislate discrimination? Enough is enough,” he tweeted Wednesday.