Five months after outlawing anti-discrimination protections for lesbians, gays, bisexuals and transgender people, North Carolina is feeling the repercussions of the controversial move.

Citing the law, known as HB2, the National Basketball Association said late Thursday that it is pulling its annual All-Star game from Charlotte, North Carolina, which had been scheduled to host the 2017 contest.

"While we recognize that the NBA cannot choose the law in every city, state, and country in which we do business, we do not believe we can successfully host our All-Star festivities in Charlotte in the climate created by HB2," the league said in a statement that noted the NBA's commitment to "diversity, inclusion, fairness and respect for others."

Get Breaking News Delivered to Your Inbox

The NBA said it might be open to playing the game in Charlotte in 2019 provided an "appropriate resolution" is found. The league will announce a new location for next year's game in the coming weeks.

👏 NBA. If you want an inclusive city, respectful of all gender identities, to host All-Star game: NYC welcomes you back. — Bill de Blasio (@BilldeBlasio) July 21, 2016

North Carolina Gov. Pat McCrory, who quickly signed the measure into law after the state's Republican-controlled legislature approved it, lashed out at the "sports and entertainment elite" and the "liberal media," saying the state legislation had been misrepresented by both.

"Most people believe boys and girls should be able to use school bathrooms, locker rooms and showers without the opposite sex present," the governor said in a statement late Thursday. "American families should be on notice that the selective corporate elite are imposing their political will on communities in which they do business, thus bypassing the democratic and legal process."

Ironically, the state's action was set in motion by an anti-discrimination ordinance passed in Charlotte in February that would have allowed transgender people to use public bathrooms that align with their gender identity, instead of their birth gender.

No matter how strongly I disagreed with #HB2, I still asked NBA to stand in solidarity with Charlotte. Don't punish the city that stood up. — Sen. Jeff Jackson (@JeffJacksonNC) July 21, 2016

The law passed by the North Carolina legislature not only prevents municipalities from adopting ordinances permitting such bathroom use, but also blocks cities from protecting gays and bisexuals from discrimination more broadly.

It also bans local governments from raising minimum wages above the state level and did away with anti-discrimination safeguards for veterans.

North Carolina's legislative move prompted a raft of protest, including by corporations. PayPal cancelled its plan to open a global operations center in Charlotte, that would have employed more than 400 people, while Apple (AAPL), Google (GOOGL), American Airlines (AAL) and Bank of America (BAC) have all called for the law's repeal.

Some government officials in other cities also publicly campaigned for the right to host next year's NBA All-Star game. "If you want an inclusive city, respectful of all gender identities, to host All-Star game: NYC welcomes you back," New York City Mayor Bill de Blasio said in a tweet.