Adam Silver and the NBA All-Star Weekend will move back to Charlotte in 2019. (Dan Anderson/EPA)

The NBA announced Wednesday that Charlotte will host the 2019 All-Star Weekend after the league had taken this year’s game away from the city because of North Carolina’s so-called “bathroom bill,” which required transgender individuals to use public restrooms that correspond with the sex listed on their birth certificates. The state recently repealed some portions of that March 2016 law, called House Bill 2, and last month NBA Commissioner Adam Silver said the league would once again consider letting Charlotte host the midseason exhibition in 2019.

“For three decades, the NBA has had a home in Charlotte,” NBA Commissioner Adam Silver said Wednesday in a statement. “Generations of families have attended games there, and fans from many different walks of life have come together to share a passion for a team that is an anchor in the community.

“We have decided to award NBA All-Star 2019 to Charlotte based on this deep connection and the belief that we can honor our shared values of equality and inclusion, and we are excited to bring the All-Star Game back to Charlotte for the first time in 28 years.”

The new law, called House Bill 142, partially repealed House Bill 2 by forbidding government entities from enacting rules on multiple-occupancy bathrooms, showers and changing rooms unless it is “in accordance with an act of the General Assembly.” However, it still bans local municipalities from enacting their own nondiscrimination ordinances before 2020. A number of advocacy groups condemned the new law, saying it was a repeal in name only.

“While we understand the concerns of those who say the repeal of HB2 did not go far enough, we believe the recent legislation eliminates the most egregious aspects of the prior law,” Silver said Wednesday. “Additionally, it allows us to work with the leadership of the Hornets organization to apply a set of equality principles to ensure that every all-star event will proceed with open access and anti-discrimination policies. All venues, hotels and businesses we work with during all-star will adhere to these policies as well.”

In a list of “principles for equality” the NBA released along with Wednesday’s announcement, the league specifically mandated that all restrooms used for all-star game activities “will be open for use by all individuals consistent with their gender identities.” It also said that such principles must be written into any contract “with any subcontractor providing goods, services, or facilities in connection with NBA All-Star 2019.”

Nevertheless, a nonprofit group that advocates for inclusive sports communities called the NBA’s decision “troubling.”

“We’re hopeful the NBA and its partners will use this opportunity to invest in the safety and wellbeing of the LGBT athletes, coaches, fans, officials and administrators that continue to operate in a state that discriminates against them daily,” Hudson Taylor, executive director of Athlete Ally, said in a statement.

The NCAA announced in April that it will once again hold championship events in North Carolina after moving them out of the state this academic year because of House Bill 2. It had threatened to withhold its biggest contests from the state until 2022 unless North Carolina lawmakers repealed the initial bathroom bill. A number of other businesses and entertainers also announced that they would be avoiding the state because of House Bill 2, costing it millions in lost revenue.

The 2019 All-Star Game and the festivities that lead up to it will be held Feb. 15-17 of that year.

“All-Star Weekend is an international event that will provide a tremendous economic impact to our community while showcasing our city, our franchise and our passionate Hornets fan base to people around the world,” Hornets owner Michael Jordan said in a statement on Wednesday.