North Carolina lawmakers today approved a measure to repeal the state’s controversial “bathroom bill,” which critics have called the most anti-LGBT bill in the country.

Legislators have been eager to roll back the year-old law, which is estimated to have already cost the Tar Heel State millions of dollars in lost business, including from the cancellation of major sports events.

But LGBT activists have denounced the new legislation, which they say would still allow discrimination by leaving the state in charge of determining which public bathrooms transgender individuals can access and barring municipalities for several years from passing local laws to protect people from discrimination.

What is the ‘bathroom bill’?

The Public Facilities Privacy and Security Act, commonly known as House Bill 2 or HB2, was signed into law in North Carolina by Republican former Gov. Pat McCrory on March 23, 2016.

HB2, dubbed the “bathroom bill,” declares that state law overrides all local ordinances concerning wages, employment and public accommodations. Thus, HB2 bars local municipalities from establishing their own rules prohibiting discrimination based on sexual orientation and gender identity in housing and public accommodations, such as public restrooms.

The law also directs all public schools, government agencies and public college campuses to require that multiple-occupancy bathrooms and changing facilities, such as locker rooms, be designated for use only by people based on their “biological sex” as stated on their birth certificate. Under the law, transgender individuals are allowed to use bathrooms and changing facilities consistent with their gender identity only if they get the biological sex on their birth certificate changed.

The “bathroom bill” has sparked widespread backlash, boycotts, protests and even legal battles. The NBA, for example, announced in July 2016 that it was moving its 2017 All-Star Game out of Charlotte over concerns about the law. Similarly, the NCAA announced in September 2016 it would relocate its 2016–17 season championship games out of the Tar Heel State.

Earlier this week, an analysis by The Associated Press found that a continuation of HB2 would cost North Carolina an estimated $3.76 billion in the loss of businesses, jobs and consumer spending over the course of 12 years.

The national American Civil Liberties Union (ACLU), the ACLU of North Carolina, Lambda Legal and a private law firm announced last year that they had filed a federal lawsuit challenging HB2 on behalf of four LGBT North Carolinians and members of the ACLU of North Carolina. The case is scheduled for oral arguments before the U.S. Court of Appeals for the Fourth Circuit in Richmond, Virginia, on May 10.

Why was HB2 passed and who supports it?

Republican lawmakers, who make up the majority of North Carolina’s General Assembly, passed HB2 in response to a then-newly approved ordinance in Charlotte that would have prohibited discrimination in housing and public accommodations based on someone’s gender identity or sexual orientation.

John Rustin, president of the North Carolina Family Policy Council, testified before the state’s Senate last year, saying that the Charlotte ordinance "means men could enter women's restrooms and locker rooms -- placing the privacy, safety, and dignity of women and the elderly at great risk."

McCrory agreed in a statement he wrote after signing the bill.

"The basic expectation of privacy in the most personal of settings, a restroom or locker room, for each gender was violated by government overreach and intrusion by the mayor and city council of Charlotte," he said at the time. "As a result, I have signed legislation passed by a bipartisan majority to stop this breach of basic privacy and etiquette which was to go into effect April 1."

What is the ‘compromise’ bill?

After days of marathon negotiations, North Carolina’s Republican House Speaker Tim Moore and Senate leader Phil Berger announced at a news conference late Wednesday night that they had reached “a major compromise agreement” with the state's new Democratic governor, Roy Cooper, to repeal HB2. Cooper, who narrowly defeated McCrory in 2016, is a staunch critic of HB2.

The proposed bill would repeal HB2. But it would still prevent local governments, schools and others from regulating multi-stall bathrooms, showers and changing areas. Regulation of those facilities would still fall to the state legislature.

The compromise bill would also prohibit local governments from enacting their own nondiscrimination ordinances until December 2020. That temporary moratorium would allow time for pending federal litigation over transgender issues to play out, according to Moore and Berger.

"Compromise requires give and take from all sides, and we are pleased this proposal fully protects bathroom safety and privacy," the two Republican lawmakers said in a joint statement Wednesday night.

The deal came after the NCAA had said North Carolina sites won’t be considered for athletic championship events for several years “absent any change” in HB2. It’s unclear whether the NCAA, which regulates athletics at more than 1,200 colleges nationwide, would be satisfied by the new proposal.

What the compromise bill doesn’t do is answer the issue at the heart of HB2 and the Charlotte ordinance. As The Charlotte Observer’s editorial board points out, the new legislation “dodges the whole bathroom question.”

They write, "Charlotte's ordinance allowed transgender individuals to use the public bathroom of the gender with which they identify. HB2 banned that. The new law does not specify what transgender people are to do."

What's next for the compromise bill?

The proposed bill cleared all of its hurdles today in North Carolina's legislature, passing through the Senate this morning and the House this afternoon.

The bill was sent to the governor, who supports the measure and is expected to sign it despite sharp criticism from activists, according to ABC-owned station WTVD in Raleigh.

Previous attempts to repeal HB2 have failed over the past year, including one during a special session in North Carolina’s legislature in December that fell apart amid partisan finger-pointing.

What are opponents saying?

LGBTQ rights groups and activists who have fought against HB2 blasted the compromise bill, particularly over its temporarily banning municipalities from passing their own anti-discrimination laws.

“At its core, it's a statewide prohibition on equality," Human Rights Campaign president Chad Griffin told reporters on Wednesday of the compromise bill. He said Cooper, whom gay rights activists supported in North Carolina’s gubernatorial election last year, could get the blame for backing a "dirty deal."

"This repeal is nothing but a replacement of the same discrimination of the original HB2,” ACLU staff attorney Chase Strangio told ABC News in a statement today. “With so many trans young people facing discrimination, trans women of color being murdered, and real problems facing our country, it is a disgrace that North Carolina is acting once again to target our vulnerable community.”

"If you vote for this bill you are not a friend of the LGBTQ community," Equality North Carolina executive director Chris Sgro told reporters this morning.

ABC News’ Karma Allen, Mary Kathryn Burke, Joshua Hoyos, Chad Murray and Avianne Tan contributed to this report. The Associated Press also contributed to this report.