Lawmakers in North Carolina reached an agreement to repeal the state's controversial "bathroom bill," local politicians announced Wednesday. The legislation prevents transgender people from using the restrooms that correspond with their gender identity.

Even before it passed in March 2016, House Bill 2 received a backlash from LGBTQ activists, as well as myriad companies that are based in North Carolina or do business there. In July, nearly 70 companies, including Apple, Nike, and American Airlines, filed a court brief against the state in an attempt to block HB2.

If left in place, the law could cost North Carolina $3.76 billion in lost business over the next 12 years, according to the Associated Press. One major blow came from PayPal, which killed plans to open a payment center in Charlotte. Additionally, the National Collegiate Athletic Association threatened to refrain from holding events in the state for the next six years unless the bill was repealed.

Wednesday's agreement leaves regulation of "multi-occupancy facilities to the state," and adds a "temporary moratorium on local ordinances" that allow people to use the bathroom of their choice, according to Representative Tim Moore and Senator Phil Berger of North Carolina's General Assembly. The repeal vote is expected to be held in the state legislature Thursday morning.

"Compromise requires give and take from all sides, and we are pleased this proposal fully protects bathroom safety and privacy," Moore and Berger said in a statement.