The National Basketball Association (NBA) on Thursday announced that it was moving next year's All-Star game from Charlotte over North Carolina's law that targets the LGBT community.

House Bill 2 has been under fire since it was approved in March during a one-day special session. The law blocks cities from enacting LGBT protections and prohibits transgender people from using the bathroom of their choice in government buildings, including schools.

Republican lawmakers and Governor Pat McCrory have resisted calls to repeal the law and have pledged to defend it in court.

NBA Commissioner Adam Silver had threatened to move the event out of Charlotte unless the law was altered.

“Our week-long schedule of All-Star events and activities is intended to be a global celebration of basketball, our league, and the values for which we stand, and to bring together all members of the NBA community – current and former players, league and team officials, business partners, and fans,” the league said in a statement.

“While we recognize that the NBA cannot choose the law in every city, state and county 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 added.

The NBA said that it might return the game to Charlotte in 2019 “provided there is an appropriate resolution to this matter.”