(Reuters) - Facing the loss of complete control of state government next month, Wisconsin Republicans passed legislation on Wednesday to weaken the powers of the newly elected Democratic governor and attorney general.

The final votes in the state Senate and Assembly came around dawn, following hours of debate during which Democrats accused Republicans of a naked last-minute power grab that ignores the results of the Nov. 6 election.

Republicans defended the legislation as a good-faith effort to ensure the legislative and executive branches remain equals.

Republican Governor Scott Walker, who was heckled with chants of “Shame!” from dozens of protesters during a Tuesday tree-lighting ceremony, has indicated he will sign the legislation. His office did not respond to a request for comment on Wednesday.

Governor-elect Tony Evers, the Democrat who will succeed him in January, issued a blistering statement criticizing the vote.

“Power-hungry politicians rushed through sweeping changes to our laws to expand their own power and override the will of the people of Wisconsin who asked for change,” he said.

The Wisconsin legislation would allow legislators, rather than the attorney general, to decide whether to withdraw the state from lawsuits. That measure is aimed at preventing Evers and the incoming attorney general, Josh Kaul, from following through on campaign promises to end Wisconsin’s challenge to the federal Affordable Care Act, popularly known as Obamacare.

The legislation also restricts Evers’ ability to install rules that implement state laws.

Democrats have said they expect the new bills to be challenged in court.

HAMSTRINGING MICHIGAN DEMOCRATS

Republican legislative majorities in other states where Democrats gained power in November have also sought to use lame-duck sessions to push through priorities and hamstring incoming Democrats.

Michigan’s Republican-led legislature was poised on Wednesday to advance measures that would allow lawmakers to sidestep the attorney general in litigation and strip away campaign finance oversight from the secretary of state. Both posts, along with the governor’s mansion, will be turned over to Democrats in January after eight years of total Republican control.

Republicans in the state also watered down minimum wage and sick leave laws on Tuesday, the culmination of a months-long strategy that involved passing the initial bills in September to keep the measures from appearing on November’s ballot as a voter referendum. Democrats have called the move illegal and vowed to sue.

North Carolina’s Republican-dominated legislature could approve a new voter identification law as soon as Wednesday during its own lame-duck session. The Republicans are pushing to finish the ID law before January, when they will lose the supermajority that can currently overcome Democratic Governor Roy Cooper’s veto.

The various efforts are reminiscent of maneuvers by North Carolina Republicans to remove powers from the governor’s office after Cooper won election in 2016.

Meanwhile, investigators are probing the validity of hundreds of mail-in ballots handled by political operatives in a closely contested congressional race that has led the state to hold off certifying a Republican’s apparent victory.