(Reuters) - The NBA is moving its 2017 All-Star Game out of Charlotte, North Carolina, given its objections to a state law decried as discriminatory against the lesbian, gay, bisexual and transgender community, the league on Thursday.

Slideshow ( 2 images )

The NBA has been opposed to House Bill 2, or HB2, since it was passed in March and tried to work with local governments to change the law before ultimately making a decision of relocating its mid-February exhibition.

“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.

The NBA also said a new location for next year’s All-Star Game will be made in the coming weeks. The exhibition, which generates millions of dollars in economic activity, could be rescheduled for Charlotte in 2019 if there is an “appropriate resolution to this matter.”

An earlier Yahoo report, citing sources, said New Orleans, which hosted the game in 2008 and 2014, was a likely replacement for the mid-season extravaganza.

Moving the event out of the state follows similar moves by top entertainers that have canceled shows in North Carolina, including Bruce Springsteen, Demi Lovato, Nick Jonas, Boston, Pearl Jam, Ringo Starr and the group Cirque du Soleil.

“There was an exhaustive effort from all parties to keep the event in Charlotte, and we are disappointed we were unable to do so,” Michael Jordan, chairman of the Charlotte Hornets, said in a statement. “With that said, we are pleased that the NBA opened the door for Charlotte to host All-Star Weekend again as soon as an opportunity was available in 2019.”

The law made North Carolina the first U.S. state to require transgender people to use restrooms in public buildings and schools that match the sex on their birth certificate rather than their gender identity.

Following the NBA’s decision, North Carolina’s Republican governor, Pat McCrory, issued a scathing statement in which he said: “the sports and entertainment elite,” among others, “misrepresented our laws and maligned the people of North Carolina simply because most people believe boys and girls should be able to use school bathrooms, locker rooms and showers without the opposite sex present.”

McCrory did not mention the NBA but went on to say “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.”

LGBT rights advocates hailed the NBA’s decision as a clear message that discriminatory legislation will not be tolerated.

“Today the NBA and Commissioner (Adam) Silver sent a clear message that they won’t stand for discrimination against LGBTQ employees, players or fans,” Human Rights Campaign president Chad Griffin said.

“The NBA repeatedly warned state lawmakers that their hateful HB2 law created an inhospitable environment for their 2017 All-Star Game and other events.”

“We appreciate the leadership of the NBA in standing up for equality and call once again on lawmakers to repeal this vile HB2 law.”

But Tami Fitzgerald, executive director of NC Values Coalition, which supports the bathroom law, criticized the NBA’s decision.

“The NBA should be ashamed of itself for using North Carolina—particularly its young girls—as a political pawns for an out-of-touch agenda that compromises both dignity interests and privacy rights,” Fitzgerald said in a statement.