Candidates for Governor of North Carolina Democrat Roy Cooper, left, and Republican Gov. Pat McCrory, right, debate at WRAL studios in Raleigh NC on Tuesday, Oct. 18, 2016. Photo: (Chris Seward/The News & Observer via AP)

Candidates for Governor of North Carolina Democrat Roy Cooper, left, and Republican Gov. Pat McCrory, right, debate at WRAL studios in Raleigh NC on Tuesday, Oct. 18, 2016. Photo: (Chris Seward/The News & Observer via AP)

RALEIGH, N.C. (AP) — North Carolina’s gubernatorial candidates clashed Tuesday in a live televised debate over the state’s economy, coal ash pits and a law signed by Republican Gov. Pat McCrory that prompted a national uproar over its impact on LGBT people.

In what’s likely to be their final debate, McCrory sought anew to blame rival Democratic Attorney General Roy Cooper and a political alliance with Charlotte’s mayor for forcing Republican leaders in Raleigh to pass the controversial law known as House Bill 2.

The law approved last March limits nondiscrimination ordinances by local governments for lesbian, gay, bisexual and transgender people. It also requires transgender people to use bathrooms and locker rooms in public schools and government buildings that correspond to the gender on their birth certificate.

McCrory said he and the legislature acted because Charlotte city leaders had expanded their nondiscrimination ordinance to cover hotels, restaurants and stores that would be forced to let people use the bathroom matching their gender identity.

“The left brought this issue up, not the right,” McCrory said, also blaming LGBT activists with the group Human Rights Campaign for forcing the issue. Without the bathroom directive by Charlotte, he added, “I don’t think we would have had any problems because I don’t believe in any type of discrimination.”

Gay rights groups, corporate CEOs and entertainers have blasted the law as state-sanctioned bigotry, and the federal government sued to overturn the law. McCrory, supported by social conservatives, has gone to court to get the bathroom provisions upheld.

Cooper kept to his own mantra of blaming McCrory for harming North Carolina’s reputation by signing the law, pointing out that it prevents local and state governments from barring private businesses from employment discrimination because someone is gay.

These and other provisions are “why we are suffering such economic damage for it,” Cooper said at the WRAL-TV studios, adding that “it writes discrimination into our law and it is wrong, period.”

McCrory said he would be willing to compromise and pass a law prohibiting hiring discrimination for the LGBT community if House Bill 2 opponents agree to back off allowing people to use the bathroom corresponding to their gender identity. He tried to get Cooper to agree to it at their debate. Cooper has no formal role passing legislation. Similar negotiations between Charlotte leaders and Republicans in Raleigh have failed.

While Libertarian candidate Lon Cecil also took the debate stage, it’s Cooper and McCrory who have been battling it out for more than two years, with the two candidates and their allies spending roughly $20 million in broadcast TV ads through last week. Most recent polls have shown the race statistically even. National Democrats see North Carolina as their best chance to flip a state where the governor is currently a Republican.

McCrory and Cooper shared the stage in a blistering debate last week in which McCrory was clearly the more aggressive of the two. On Tuesday, both of them sought to attack.

They differed on whether the economy has really benefited from McCrory’s leadership, especially on income tax reductions he signed into law. Cooper has said they have disproportionately benefited the wealthy. McCrory asked Cooper whether he would raise the rates if he became governor. Cooper repeated that he would only seek to “fix some of those taxes that he put on the middle class and small business.”

Cooper criticized McCrory for his handling of the cleanup of coal ash held in pits by Duke Energy, his former employer, as well as on ensuring nearby residents believe they have safe drinking water. McCrory countered that Cooper did very little as attorney general for the past 16 years to address a problem that was decades in the making.

Watch the candidates face off on HB2 in the video below.

© 2016, Associated Press, All Rights Reserved.

This material may not be published, broadcast, rewritten, or redistributed.