North Carolina Governor Roy Cooper, a Democrat, on Wednesday signed an executive order barring discrimination based on sexual orientation and gender identity in state employment.

Cooper's office also announced that it had reached an agreement in a case challenging House Bill 142. Under the terms of a proposed consent decree, transgender people can use the public bathroom of their choice.

“Earlier this year, I said there was more work to do to protect against discrimination and make North Carolina a welcoming state,” Cooper said in a statement. “Today’s executive order and consent decree are important steps toward fighting discrimination and enacting protections throughout state government and across our state.”

The consent decree is the outcome of a lawsuit filed by the American Civil Liberties Union (ACLU) and Lambda Legal, which at first challenged House Bill 2, the law signed by former Governor Pat McCrory, a Republican, that prohibited transgender people from using the bathroom of their choice and blocked local municipalities from enacting LGBT protections.

Passage attracted nationwide attention, boycotts and protests. Cooper campaigned on a promise to repeal the law and McCrory's loss was widely blamed on his continued defense of the law.

Lawmakers repealed the law in late March and replaced it with House Bill 142. The new law leaves bathroom regulation to the state and enacts a moratorium on local LGBT protections until December 1, 2020. The ACLU and Lambda Legal modified their lawsuit to challenge House Bill 142.

The proposed consent decree clarifies that House Bill 142 cannot be enforced to bar transgender people from using the bathroom of their choice in government buildings, but leaves other components of the law intact.

The Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, applauded the governor's actions in a statement, but added that more must be done.

“While this executive order may represent some narrow improvements for LGBTQ North Carolinians, by no means does it offer full protections or rectify the tremendous harm caused by HB2 and continued harm from HB142,” said JoDee Winterhof, senior vice president of policy and political affairs at HRC. “Gov. Cooper and state lawmakers must show leadership on the real solution for North Carolina — statewide, LGBTQ non-discrimination protections.”