Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A deal that North Carolina lawmakers reached to repeal the state's controversial and costly "bathroom bill" passed on Thursday after a contentious debate — but the compromise has left LGBTQ advocates exasperated, with some calling it "shameful" and an "outrageous betrayal."

Democratic Gov. Roy Cooper signed the bill into law just hours after the state's House passed the bill 70-48 on Thursday afternoon after nearly two hours of heated debate.

The state's Senate passed the bill by a 32-16 vote earlier in the day, after a deal was struck late Wednesday between the state’s new governor, who campaigned on fully repealing the HB2 bill, and North Carolina’s leading Republican lawmakers, who have supported the measure.

Cooper announced he had signed the bill at a press conference Thursday afternoon, saying HB2 had been "a dark cloud hanging over our great state."

"It has stained our reputation, it has discriminated against our people and it has caused great economic harm in many of our communities," he said.

Cooper acknowledged the limitations of the deal, and said the new law was "not a perfect deal and it's not my preferred solution. It stops short of many things we need to do as a state."

HB2 was passed last March under former Gov. Pat McCrory. The bill sparked a massive political and financial backlash and a showdown with the NCAA.

The NCAA has said it would not let North Carolina host college championship games through the year 2022 unless there were changes to the law made by Thursday.

Related: North Carolina Lawmakers Announce Deal to Repeal ‘Bathroom Bill’

LGBTQ and civil rights advocates have called for a full repeal of the bill, and denounced the new compromise over provisions they say will still allow for discrimination: namely a three-year ban on local nondiscrimination ordinances.

North Carolina Senate President pro tem Republican Phil Berger left, and Senate Democratic leader Sen. Dan Blue. Chris Seward / News and Observer via AP

It was one of those local ordinances that led to the state's Republican-controlled legislature to pass HB2 in the first place, after state lawmakers sought to block a law passed in Charlotte that allowed transgender people to use the restroom they wanted.

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

HB2 prohibited Charlotte's law and stopped other municipal governments from passing similar measures.

The compromise bill weaves in several provisions, including repealing HB2, leaving state legislators in charge of policy over multi-stall bathrooms, and puts a temporary halt on local governments passing nondiscrimination ordinances until 2020 — which lawmakers say would allot time for ongoing court cases on transgender issues to play out.

The American Civil Liberties Union and Lambda Legal released a statement condemning the bill's passing.

“This is not a repeal of HB 2. Instead, they’re reinforcing the worst aspects of the law,” James Esseks, director of the ACLU LGBT Project, said in the statement. “North Carolina lawmakers should be ashamed of this backroom deal that continues to play politics with the lives of LGBT North Carolinians.”

Simone Bell, Southern regional Director at Lambda Legal added: “Lawmakers replaced a bad bill with another bad bill. This fake repeal is an attempt to silence LGBT people. It is shameful to stamp a start date on equality. We demand a full, clean repeal, and that includes comprehensive non-discrimination protections."

The ACLU of North Carolina said it was delivering a letter to Cooper urging him to veto the measure, despite his expressed support.

We call on @NCAA a to stand with us and transgender people and against discrimination. Don't settle for this fake repeal. #RepealHB2 — ACLU National (@ACLU) March 30, 2017

The group had come out strongly against the deal in a series of tweets earlier Thursday, calling on the NCAA to reject the deal and not "settle for this fake repeal."

Sarah Kate Ellis, president and CEO of the Gay & Lesbian Alliance Against Defamation, called the replacement bill "politics at its worse."

"This so-called 'deal' is politics at its worst and was only made as the state faced losing key NCAA events and further economic damage," Ellis said in a statement. "Any human being, regardless of who they are, should always come before a basketball game — but apparently the North Carolina state government still doesn't understand that concept."

Even transgender icon, reality TV star and Olympic gold medalist Caitlyn Jenner said on Twitter that the new bill ordered North Carolina cities "to discriminate against LGBT people until at least 2020."

The new law orders NC cities to discriminate against LGBT people until at least 2020 and unfair "bathroom bans" remain.. — Caitlyn Jenner (@Caitlyn_Jenner) March 30, 2017

And Rev. William Barber, the president of the state's NAACP, said in a statement before it was passed that "any moratorium on civil rights is not a compromise, it is a contradiction with the principle of equal protection under the law and our moral values."

Mara Keisling, executive director of the National Center for Transgender Equality said the compromise bill was "a cynical ploy that will continue to hurt North Carolina and transgender people."

Opponents of North Carolina's HB2 law protest above the state's House of Representatives chamber in December last year. Jonathan Drake / Reuters, file

“Transgender North Carolinians are being squarely targeted by HB2 and would continue to be targeted by the provisions of this new law," Keisling said, later adding. "It is an outrageous betrayal that [Cooper] supports this fake repeal.”

North Carolina Republican Senator Thom Tillis came out in support of the bill's passing in a statement on Twitter on Thursday, saying he was glad state lawmakers reached a "commonsense compromise to repeal HB2."

My statement on the North Carolina General Assembly's vote to repeal House Bill 2. #NCGA #ncpol #HB2 pic.twitter.com/dR6yp0es3b — Senator Thom Tillis (@SenThomTillis) March 30, 2017

Cooper said at his press conference Thursday that "this was the best deal" he could get the Republican-led legislature to agree to.

"In a perfect world with a good General Assembly, we would have repealed House Bill 2 fully today and added full state wide protections for LGBT North Carolinians," he said, adding that Republican lawmakers would not allow him to pass those protections.

"But this is an important goal that I will keep fighting for," he said.

In a joint statement on Wednesday when the deal was announced, Republicans House Speaker Tim Moore and Senate Leader Phil Berger said, “Compromise requires give and take from all sides, and we are pleased this proposal fully protects bathroom safety and privacy.”

The compromise comes after a failed attempt to repeal HB2 in December.

An analysis from the Associated Press found that HB2 would cost the state more than $3.76 billion in lost business over a dozen years.

The NBA decided to pull its 2017 All-Star game out of Charlotte back in July. The AP analysis found that the NBA, a Bruce Springsteen show as well as other canceled conventions, concerts and sports events have deprived the state of more than $196 million.

Other financial hits the state has suffered, the AP notes, include abandoned plans for a PayPal facility that would have added an estimate $2.66 billion to the state's economy and a cancelled Ringo Starr concert worth about $33,000 in revenue.