A gender-neutral bathroom seen at the University of California at Irvine in Irvine, California, in 2014. Reuters/Lucy Nicholson RALEIGH, North Carolina — North Carolina's attorney general said Tuesday he wouldn't defend in court a new state law preventing Charlotte and other local governments from approving protections for LGBT people, calling it discriminatory and a "national embarrassment."

Democrat Roy Cooper made the announcement during a news conference a day after gay-rights advocates sued to overturn the law approved last week and signed by Republican Gov. Pat McCrory.

The federal lawsuit lists Cooper among the defendants because of his official position as the state's top lawyer. But he has said he wants it repealed.

"We know that businesses here and all over the country have taken a strong stance in opposition to this law," Cooper said.

McCrory is also a defendant in the lawsuit and has doubled down on justifying his decision to sign the law, even as many corporations have criticized it publicly.

Cooper's announcement raises the stakes for the November governor's race, in which Cooper is challenging McCrory. National Democrats consider it their best opportunity to pick up a governor's mansion where a Republican currently resides. The campaigns of McCrory and Cooper already have raised more than $13 million combined, and the Republican Governors Association has reserved $4 million in ad time for the fall.

The Republican-led legislature and McCrory approved the law because they say Charlotte went too far with a local ordinance allowing transgender people to use the restroom aligned with their gender identity. They have focused on the threat — used by opponents of Houston's LGBT ordinance last year while defeating it in a referendum — that sexual predators could use these kinds of rules as a pretense to enter women's bathrooms and locker rooms. Gay-rights groups have called these and other arguments bogus.

The law also directs North Carolina's public schools, public universities, and government agencies to require bathrooms or locker rooms be designated for use only by people based on their biological sex. They can offer single-occupancy facilities.

Gov. Pat McCrory of North Carolina. Chris Keane / AP

Cooper's decision continues a yearslong tussle between him and Republican leaders in state government, who say they don't trust the attorney general to robustly defend state laws challenged in court.

Cooper, the attorney general since 2001, has expressed his personal opposition to a law that placed new restrictions on voting, including a photo identification mandate to vote in person. But he has said it was his duty for the state to be represented in a professional manner in pending litigation challenging the voting changes. Legislative leaders and McCrory, however, have hired outside counsel to sit beside the state attorney in this and other cases.

House Speaker Tim Moore and Senate leader Phil Berger said Monday they couldn't respond to whether they would hire outside lawyers in the transgender lawsuit until they found out Cooper's plans.