In this photo taken Tuesday, Oct. 11, 2016 North Carolina Republican Gov. Pat McCrory applauds during a debate with Democratic challenger Attorney General Roy Cooper, not shown, in a live televised debate in Research Triangle Park, N.C. The North Carolina governor's race is everything voters anticipated it would be: expensive attack ads and barbed debates before what's essentially a referendum on the state's recent rightward tilt under Republican rule, particularly the state law limiting protections for LGBT people _ known as House Bill 2. Photo: AP Photo/Gerry Broome, File

In this photo taken Tuesday, Oct. 11, 2016 North Carolina Republican Gov. Pat McCrory applauds during a debate with Democratic challenger Attorney General Roy Cooper, not shown, in a live televised debate in Research Triangle Park, N.C. The North Carolina governor's race is everything voters anticipated it would be: expensive attack ads and barbed debates before what's essentially a referendum on the state's recent rightward tilt under Republican rule, particularly the state law limiting protections for LGBT people _ known as House Bill 2. Photo: AP Photo/Gerry Broome, File

GREENSBORO, N.C. (AP) — Republican Gov. Pat McCrory has been unable to quash the firestorm over his signing of a law limiting protections for LGBT people, while trying to focus his re-election bid on North Carolina’s economy, taxes, teacher pay and his recent response to historic flooding.

That legislation has reinforced this election as a referendum on North Carolina’s conservative shift under McCrory and the Republican-led legislature. The gubernatorial contest is one of the nation’s most competitive, with several polls showing McCrory and Democratic Attorney General Roy Cooper in a statistical tie.

Cooper wants to repeal the law known as House Bill 2, which among other things directs transgender people to use bathrooms in schools and government buildings that correspond to the sex on their birth certificates. He also says he’ll work to restore the state’s progressive image if elected and has launched an ad blasting the LGBT law, saying it’s “trashed our brand” and cost thousands of jobs.

“North Carolina is better than this. We always have been. We will be again,” Cooper, the state’s attorney general since 2001, told dozens of Democratic volunteers working for him in Greensboro.

McCrory got a shot at resetting the campaign narrative this month following flooding triggered by Hurricane Matthew, as he made near-daily appearances on the news leading response and recovery efforts. One of his recent ads shows footage from the storm and the riots sparked by the fatal shooting of a black man by Charlotte police.

“The last four years I’ve focused on my job as governor. The campaign has always been secondary,” McCrory told The Associated Press in an interview, adding that with “any event that happens in a state … you just do your job. But I assume if we didn’t do it right, there would be political ramifications.”

The state’s response earned McCrory support from even Democrats, like David Parker, 72, of Rocky Mount. He said he voted for McCrory because he has “stood out during Hurricane Matthew and been very responsive to the people in eastern North Carolina that have been in some problems.” Flooding from Matthew overwhelmed Rocky Mount roads and other buildings and rose to 7 feet in downtown Princeville nearby. McCrory visited the two towns in the past week.

The Cooper-McCrory campaign basically began in 2013 after Cooper, a 30-year veteran of state politics, started speaking out against legislation approved by the Republican-controlled General Assembly and signed by McCrory. They included a wide-ranging ballot access law that required photo identification to vote and scaled back early in-person voting by seven days.

A federal appeals court in July struck down the voter law as racially motivated, giving further proof to those angry with McCrory about House Bill 2 that he hasn’t led like the moderate former seven-term Charlotte mayor they thought they were getting when he was elected in 2012.

“Anyone who lives in North Carolina has now been hurt by something that a few individuals think they can pass,” said William Brinkley, 27, a registered independent from Charlotte who voted for McCrory in 2012. He said recently he won’t this time.

Like other Democratic candidates, Cooper benefited from a massive get-out-the-vote operation by Hillary Clinton’s presidential campaign as early in-person voting began Oct. 20. The campaign has been expensive and nasty: Cooper and several allied groups have outspent McCrory and his supporters, with Cooper’s campaign airing almost twice as many ads on broadcast television so far than McCrory, according to data analyzed by the Center for Public Integrity.

Cooper is “for everything that I stand for,” said Charles Upchurch, 76, of Raleigh, a registered Democrat wearing an NAACP shirt and waiting to vote in downtown Raleigh. “Jobs for one, but right now justice. … Civil rights for everybody. We want justices whenever we go to our courts, justice when we go downtown to the police station.”

McCrory points to a record of lower income taxes, unemployment under 5 percent and a fiscally sound state budget. Cooper said the tax cuts helped the wealthy the most and took away funds to help move teacher salaries to the national average.

Hardly a public event goes by where McCrory doesn’t answer a media question about House Bill 2. The governor sounds exasperated in a previously-run ad describing the controversy as political correctness. “Are we really talking about this?” the governor asks.

But the governor has retained support among social conservatives by defending the law. Republicans have said the law provides privacy and protection for children using restrooms and locker rooms, though the Justice Department and others argue the threat of sexual predators posing as transgender to enter a bathroom is practically nonexistent.

“I believe he’s got the state on a good moral course,” said Jerry O’Carroll, 69, a registered Republican voting early in Nash County, an hour northeast of Raleigh and where Cooper grew up.

© 2016, Associated Press, All Rights Reserved.

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