RALEIGH — North Carolina lawmakers rolled back North Carolina’s “bathroom bill” Thursday in a bid to end the backlash over transgender rights that has cost the state dearly in business projects, conventions and basketball tournaments.

The compromise plan, announced Wednesday night by the state’s Democratic governor and leaders of the Republican-controlled legislature, was worked out under mounting pressure from the NCAA, which threatened to take away more sporting events from the basketball-obsessed state as long as the law, also known as House Bill 2, was on the books.

The rollback measure cleared the House and Senate in a matter of hours and was sent to Gov. Roy Cooper for his expected signature.

Among other things, it repeals the best-known section of HB2: a requirement that transgender people use the public restrooms that correspond to the sex on their birth certificate.

But gay and transgender activists complained that the new measure still denies them certain protections from discrimination, and they demanded nothing less than full repeal.

As a result, it was unclear whether the retreat from the year-old HB2 would stop the boycott or satisfy the NCAA. An NCAA spokeswoman didn’t immediately respond to a message seeking reaction.

Republican Rep. Scott Stone, who lives in Charlotte, urged his colleagues to vote for the new bill. It passed the House 70-48.

“We are impeding the growth in our revenue, in our ability to do more things for tourism, for teacher pay, while we have this stigma hanging over,” Stone said. “The time has come for us to get out from under the national spotlight for negative things. You can’t go anywhere on this planet without somebody knowing what is HB2 and having some perception about it.”

Conservatives, meanwhile, staunchly defended HB2 and bitterly denounced the new measure.

“This bill is at best a punt. At worst it is a betrayal of principle,” Republican Sen. Dan Bishop, a primary sponsor of HB2, said on the Senate floor as the rollback was approved 32-16, with nine of 15 Democrats among the yes votes.

While the new measure eliminates the rule on transgender bathroom use, it also makes it clear that state legislators — not local government or school officials — are in charge of policy on public restrooms.

HB2 had also restricted local governments’ ability to enact nondiscrimination ordinances. Under the new measure, local governments can’t pass new nondiscrimination protections for workplaces, hotels and restaurants until December 2020.

That moratorium, according to GOP leaders, would allow time for pending federal litigation over transgender rights to play out.

“This is a significant compromise from all sides on an issue that has been discussed and discussed and discussed in North Carolina for a long period of time,” Senate leader Phil Berger said. “It is something that I think satisfies some people, dissatisfies some people, but I think it’s a good thing for North Carolina.”

Gay rights activists blasted the proposal, saying it was not a true repeal.

“It doesn’t matter if you are a Democrat or a Republican, if you vote for this bill, you are not a friend of the LGBT community,” Equality North Carolina executive director Chris Sgro said. “You are not standing on the right side of the moral arc of history or with the civil rights community.”

The deal came after the NCAA warned that North Carolina wouldn’t be considered for championship events from 2018 to 2022 unless HB2 was changed. The sports governing body said it would start making decisions on host cities this week and announce them in April.

Republican House Speaker Tim Moore said that he hadn’t spoken directly to the NCAA but that he had been told by business leaders who served as intermediaries that the bill should prove acceptable to the NCAA.

The NCAA already pulled championship events from the state this year because of HB2. Also, businesses canceled expansions or moves to North Carolina, the NBA withdrew its All-Star Game from Charlotte, and entertainers such as Bruce Springsteen canceled concerts.

An Associated Press analysis (http://apne.ws/2ocOSnu) this week found that the law would cost the state more than $3.76 billion in lost business over a dozen years.

On Thursday, Springsteen guitarist Steven Van Zandt tweeted that the legislature’s move fell short: “It ain’t over until the LGBT community and the ACLU say it’s over.”

During impassioned debate on the House floor, conservatives accused their colleagues of caving in to pressure from sports leagues.

Republican Rep. Bert Jones sarcastically suggested that the banners outside the building be replaced with a flag of the NCAA and the white flag of surrender.

And GOP Rep. Carl Ford said: “If we could have props in here, I’d take a basketball covered in money and roll it down the middle aisle there. Because that’s what this is about: money and basketball. My family is not for sale. My constituents are not for sale.”

HB2 supporters argued that the bathroom law was needed to preserve people’s privacy and protect them from sexual predators. Opponents said that was nonsense and that the danger was imaginary.

Gary D. Robertson

Emery P. Dalesio

Associated Press