North Carolina Gov. Pat McCrory and Democratic rival Roy Cooper have clashed in a televised campaign debate over a controversial state law that prevents localities from passing broad non-discrimination rules designed to protect LGBT people.

Cooper and McCrory took part in Tuesday evening's debate in the North Carolina governor's race, one of the most competitive and expensive in the nation.

At the debate in Raleigh, McCrory blamed Cooper for siding with Charlotte's mayor when the city passed a non-discrimination ordinance related to gender identity the governor said caused legislators to pass what's known as House Bill 2. He says he would be willing to compromise and pass a law prohibiting hiring discrimination for gays and lesbians if House Bill 2 opponents agree to back off allowing people to use the bathroom corresponding to their gender identity.

Cooper said McCrory is to blame for damaging North Carolina's brand by signing the law, which received national attention.