Many Democrats rose to applaud. Few Republicans did.

A lawyer and lifelong Democrat, Mr. Cooper could fit a Hollywood casting director’s vision of a Southern governor from either party. He is 59 years old and trim, with a full head of graying hair and a subtle drawl that betrays his roots in rural Nash County.

For years, he served as a state representative, then Senate majority leader, earning a reputation as a competent centrist and heir to the state’s moderate Democrat tradition.

He then spent 16 years as state attorney general, taking a turn in the national spotlight with his independent review of the racially charged and badly botched sexual assault cases that a local prosecutor had brought against three white former members of the Duke University men’s lacrosse team. Mr. Cooper declared the men innocent in April 2007. He also declined to bring criminal charges against their African-American accuser despite what he called her “faulty” accusations, a move that, like others in Mr. Cooper’s career, could be viewed as overly cautious, politically savvy or both.

During last year’s campaign, Mr. Cooper positioned himself as an even-keeled leader who would tamp down the drama in Raleigh. He won by nearly 10,000 votes, even as Donald J. Trump beat Hillary Clinton by more than 175,000 votes statewide in the presidential contest.

Republicans then spent nearly a month challenging the results. Before Mr. Cooper’s swearing-in, legislators passed the contentious laws that weakened Mr. Cooper by loosening the governor’s control over the state elections board, granting Civil Service protection to hundreds of Mr. McCrory’s political appointees and giving the Senate the ability to approve or reject the governor’s agency heads.

On Friday, a three-judge state panel issued a mixed opinion, siding with Mr. Cooper over the elections board and the Civil Service jobs, but ruling that the Senate does have the power to approve his cabinet appointees.

Even some Republicans took Mr. Cooper’s suit challenging the laws as a sign that he would not be bullied.