A spokesman for North Carolina Governor Pat McCrory has called for the state's attorney general to resign over his opposition to a controversial law that targets the LGBT community.

McCrory has defended his decision to sign into law House Bill 2, which blocks cities from enacting LGBT protections and prohibits transgender people from using the bathroom of their choice in government buildings, including schools.

North Carolina Attorney General Roy Cooper, a Democrat who is campaigning for McCrory's job, vowed soon after passage not to defend the law in court and called for its repeal.

Last week, McCrory spokesman Ricky Diaz called for Cooper's resignation after his office asked for an extension for the state to respond in a federal lawsuit.

“Cooper should resign immediately,” Diaz told ABC11.com, “not only for gross incompetence, but also the serious professional and ethical conflicts of interests he has brought upon himself by siding with the Obama administration instead of defending North Carolina.”

“He's sending wildly conflicting messages. And beyond that, he's continuing to trash the law and refusing to stand up to the Obama administration. His duty as Attorney General is to defend North Carolina,” Diaz added.

Cooper's office reiterated in a statement that Cooper will not defend the law in court.