RALEIGH, N.C. -- North Carolina Republican lawmakers and Democratic Gov. Roy Cooper said late Wednesday that they have agreed on legislation to resolve a standoff over the state’s “bathroom bill” through a replacement measure that still restricts LGBT nondiscrimination protections.

GOP leaders announced the new legislation would be debated and voted on Thursday, but it was unclear whether there were enough House and Senate votes to pass it. And leaders of gay rights groups were incensed about the anticipated proposal and vowed political punishment for elected officials who support it.

Cooper, who ran successfully last fall on a platform that included repealing House Bill 2, said in a release that he supported the compromise.

Get Breaking News Delivered to Your Inbox

“It’s not a perfect deal, but it repeals House Bill 2 and begins to repair our reputation,” he said.

The late-night work came as the NCAA has said North Carolina sites wouldn’t be considered for championship events from 2018 to 2022 “absent any change” in the March 2016 law known as House Bill 2, which it views as discrimination. The NCAA said decisions would be made starting this week on events. North Carolina cities, schools and other groups have offered more than 130 bids for such events.

The NCAA had mentioned a deadline of noon on Thursday, reports CBS Raleigh affiliate WNCN-TV.

The NCAA already removed championship events from the state this year because of the law, which limits LGBT nondiscrimination protections and requires transgender people to use restrooms in schools and government buildings corresponding to the sex on their birth certificate.

HB2 has prompted some businesses to halt expansions and entertainers and sports organizations to cancel or move events, including the NBA All-Star game in Charlotte. An Associated Press analysis this week found that HB2 already will cost the state more than $3.76 billion in lost business over a dozen years.

The new proposal would repeal HB2 but would leave state legislators in charge of policy on public multi-stall restrooms. Local governments also couldn’t pass ordinances extending nondiscrimination covering things like sexual orientation and gender identity until December 2020. That temporary moratorium, according to House Speaker Tim Moore and Senate leader Phil Berger, would allow time for pending federal litigation over transgender issues to play out.

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

Moore and Berger made the announcement after several hours of private meetings among lawmakers, with the two shuttling between their corner offices at the Legislative Building. GOP lawmakers and Cooper have been grappling for months over what to do about HB2, which the Republican-controlled legislature passed in response to a Charlotte ordinance that allowed transgender people to use restroom aligned with their gender identity.

Cooper narrowly defeated GOP Gov. Pat McCrory, who signed the law. A potential compromise failed during a special session in December, when Cooper was governor-elect.

Social conservatives want HB2 to remain in place, saying ordinances like the one in Charlotte make it easy for male sexual predators to enter public restrooms designated for the opposite sex.

Anything except a full repeal - nothing else - has drawn opposition from gay rights groups, who responded before the announcement to anticipated provisions in the legislation.

“At its core, it’s a statewide prohibition on equality,” Human Rights Campaign President Chad Griffin told reporters earlier Wednesday as details of the proposal began surfacing. “Just like we did with ... McCrory, we will hold all elected officials accountable - Democrats and Republicans - who target our community by advancing this statewide ban on nondiscrimination protections.”