ATLANTA — For a year, it prompted boycotts, demonstrations and economic fallout that helped dethrone a sitting governor. In the end, in a strange and profoundly American collision of polarized politics, big-time sports, commerce and the culture wars, North Carolina’s notorious House Bill 2 was finally laid to rest on Thursday — though many were left wondering if some of its negative effects might linger.

Gov. Roy Cooper, a Democrat, signed legislation repealing the law after it was approved by the Republican-controlled legislature. House Bill 2 had restricted the ability of municipalities to enact anti-discrimination policies and required transgender people in government and public buildings to use the bathroom that corresponds with the gender on their birth certificate.

In addition to repealing House Bill 2, the new law gives the General Assembly the sole power to regulate access to “multiple occupancy restrooms, showers or changing facilities.” It also creates a moratorium on local nondiscrimination ordinances through 2020.

The compromise agreement came amid a looming threat that the N.C.A.A., which had already relocated a year’s worth of championship tournament games from the state, was planning to eliminate more, including future men’s Division I basketball tournaments. It was met with bitter criticism from gay rights groups, which said it was barely a repeal at all, and from conservatives, who said it backtracked on protecting public safety and traditional values.