The NCAA has awarded men’s basketball tournament games in 2020 and 2021 along with several other championship events to North Carolina after the state repealed elements of a law that limited protections for LGBT people and put it at risk of being passed over as a host for future events.

The governing body announced decisions on Tuesday for events through 2022, two weeks after the NCAA said it had “reluctantly” agreed to consider North Carolina again for hosting duties. It had stripped North Carolina of seven championship events for the past sports season — including opening-weekend men’s basketball tournament games — and said it could relocate more events if there wasn’t a change in the “bathroom bill.”

The list of events included men’s basketball tournament opening-weekend games in Greensboro in 2020 and Raleigh in 2021, as well as a women’s basketball tournament regional in Greensboro in 2019. In addition, the College Cup Division I championship rounds for men’s soccer and women’s soccer will alternate years in Cary from 2018-21, and the Division I women’s field hockey championship will be held in Winston-Salem in 2019.

Democratic governor Roy Cooper signed a compromise bill in March while saying it wasn’t a perfect solution. The compromise was reached days after the NCAA said the state was down to its final days to get something done about the law.

The NCAA president, Mark Emmert, said at the final four that he was pleased the state had passed a new law despite “very difficult” politics. But the NCAA ultimately offered a lukewarm endorsement of the compromise measure days later, saying the new law met “minimal” requirements to allow NCAA back into consideration for future events.

It stated events already awarded to North Carolina for the 2017-18 sports season — including men’s basketball tournament games in Charlotte — would remain in place.

The NCAA’s North Carolina ban for the 2016-17 season didn’t affect teams that earn home-court advantage during the season, such as the Duke women’s basketball team hosting tournament games in March.

The Atlantic Coast Conference also pulled 10 neutral-site events from the state last fall, including moving the football championship game from Charlotte to Orlando, Florida. The conference said after the compromise was reached its upcoming events would remain in place and the football title game would return to Charlotte for its contractual run there through 2019.

The NBA relocated this year’s All-Star Game from Charlotte to New Orleans due to the law as well, though the league hasn’t committed to bringing its annual showcase back.

The loss of men’s basketball tournament games was particularly jarring in basketball-crazy North Carolina, the site of more tournament games (251) than any other state.

North Carolina — which hosted the 1994 Final Four in Charlotte — had hosted games in 11 of 13 years before the NCAA stripped March games from Greensboro. Those games were relocated to Greenville, South Carolina, which had been banned from hosting events for years before that was lifted following the removal of a Confederate flag from state capitol grounds in 2015.

South Carolina was also included on the list for men’s basketball sites, with Columbia hosting opening-weekend games in 2019 and Greenville hosting in 2022.

Cooper had said it was clear that the NCAA had wanted a complete repeal of House Bill 2, as did he. But the governor has said the new law was the best compromise he could get given the Republicans’ veto-proof majorities in the legislature, though it drew criticism from some LGBT rights groups that said it wasn’t good enough.

The replacement bill eliminated a requirement that transgender people use restrooms corresponding to the sex on their birth certificates in many public buildings. The new law says only state legislators — not local governments or school officials — can make rules for public restrooms.

The original bill also invalidated any local ordinances protecting gay or transgender people from discrimination in the workplace or in public accommodations. The compromise prohibits local governments from enacting any new such protections until December 2020.