Republicans, who once expanded the number of employees who serve at the governor’s pleasure in an effort to help Mr. McCrory, originally proposed shrinking the number of such workers to 300 in advance of Mr. Cooper’s inauguration. The number was increased in an amendment filed by Mr. Barefoot.

In another change, and one that could have the greatest impact in the near term, the bill makes the governor’s cabinet appointees subject to approval by the State Senate. Republicans currently enjoy veto-proof majorities in the House and the Senate, and the North Carolina governorship is historically a relatively weak office. Cabinet appointments are one of the major ways Mr. Cooper, a moderate Democrat, might be able to influence the direction of the state.

The moves have mobilized North Carolina’s sizable Democratic contingent, who have been galvanized, over the last four years, by the “Moral Mondays” protest movement led by the Rev. William Barber II, the charismatic president of the state N.A.A.C.P.

On Friday afternoon, Mr. Barber entered the state legislative building, triggering whoops and cheers from the roughly 200 protesters.

With the aid of a cane he made his way into the space outside the legislative chambers, and encouraged the protesters to risk arrest by knocking on the locked doors of the State House viewing gallery. Police had forbidden protesters to knock.

“You have to decide if you want to in fact knock on that door,” said Mr. Barber.

Some knocked. A number of them were arrested. The building throbbed as the protesters chanted, “Let Us In.”

The raucous protests Friday, and the votes along strict party lines, virtually guarantee that hyperpartisan political turmoil will continue to be the norm in this deeply divided state. Democratic protests began to swell here in 2013, after Mr. McCrory took office, and Republicans, enjoying control of both the executive and legislative branches, began rolling out an aggressive conservative agenda that limited ballot access and, with the passage of the legislation known as House Bill 2, curtailed gay and transgender rights.