Wisconsin’s Republican-controlled legislature passed legislation early Wednesday to weaken the power of the incoming Democratic governor, a move critics and Democrats said amounted to a naked power grab that subverts the will of voters.

The legislation consolidates power in the legislature and strips it from Gov.-elect Tony Evers and Attorney General-elect Josh Kaul, both Democrats. While Republicans lost all statewide seats in last month’s midterm elections, they retained majorities in both houses of the legislature, a result that Democrats said was achieved by gerrymandering.

Amid a throng of protesters, the legislature stayed in session all night to pass the bills, which will make it harder for Evers and Kaul to enact their proposed agendas. The state Senate approved the legislative package 17 to 16, and the Assembly passed it 56 to 27.

As a result of last month’s elections, Republicans picked up a seat in the state Senate, which they will control with a 19-to-14 majority, and lost one seat in the Assembly, where they will enjoy a 63-36 advantage.

Outgoing Gov. Scott Walker (R) has telegraphed his support for the legislation, which he has 10 days to sign. Evers, the state schools superintendent who bested Walker by more than 29,000 votes in last month’s election, has sharply criticized the efforts that he said “pushed aside” Wisconsin values so lawmakers could “usurp and cling to power.”

“Wisconsin has never seen anything like this,” Evers said in a statement released Wednesday. “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 on November 6th."

The legislation, passed in the lame-duck session, erodes the ability of the governor to create rules that enact laws. It also prohibits Evers from taking over a state job control agency until September 2019. Additionally, it mandates that early voting cannot take place more than two weeks before an election, even though a court ruled a similar provision unconstitutional.

The efforts in Wisconsin also come as Republicans in Michigan are similarly reacting to electoral losses by seeking to water down the authority of the newly elected governor, attorney general and secretary of state -- all Democrats.

In Wisconsin, Republicans also moved to strip power from the attorney general by requiring a legislative committee to approve whether the state can pull out of a federal lawsuit. The move is aimed at prohibiting Wisconsin from withdrawing from a lawsuit to repeal the Affordable Care Act.

Republicans also approved a plan to lock in place a work requirement for Medicaid and food stamps, which would force tens of thousands of indigent yet able-bodied and childless adults under the age of 50 to work to qualify for these public benefits. Health-care providers, insurers and hospitals have warned of adverse consequences. Both chambers also approved a transportation-related proposal, and the state Senate on Tuesday backed a series of appointments made by the outgoing governor weeks before he leaves office.

Appearing on CNN late Tuesday, Evers joined Democratic lawmakers in calling these actions a power grab.

“I see this as essentially a Republican majority trying to repudiate and turn back the clock,” he told CNN’s Don Lemon, condemning the maneuver as “an embarrassment for the state of Wisconsin.”

The severe rhetoric from the mild-mannered Midwestern educator reflected the pitch of the debate in Madison, as the second day of extraordinary legislative action spilled into the wee hours of Wednesday morning. The marathon session, marked by long delays as both sides huddled to plot the way forward, unfolded against the backdrop of protests at the state Capitol, which found an echo within the legislative chambers. State Senate Minority Leader Jennifer Shilling accused the GOP majority of “handcuffing the incoming administration.”

The state’s GOP leadership framed the undertaking as an attempt to safeguard Walker’s policy agenda, as well as to check executive authority. Republicans in Wisconsin have controlled the state government since 2011. Robin Vos, speaker of the Assembly, took to Twitter late Tuesday to defend his party’s actions, but his messages, rather than reassuring Wisconsin voters, became a lighting rod for them to voice their discontent.

Walker, addressing reporters this week, said he expected the legislation to be altered in the course of debate and promised that his approval “depends on what they send me.”

Evers, speaking to CNN, voiced defiance in the face of what he described as a baldfaced attempt to thwart the results of last month’s elections. “That’s just not going to happen,” he said. “We’re working hard to make sure it doesn’t happen.”

Yet, he also acknowledged that Republicans show no signs of relenting.

“We’ll try to convince the governor to veto it, and that’s an unlikely prospect,” he said, referring to Walker, who survived a hard-fought recall vote in 2012 and was reelected in 2014. Otherwise, he said, “we have several strategies in place, but everything’s on the table, from litigation to other actions.”

He added, “The time to stop it is now. That’s the bottom line.”

Evers said he was especially incensed by a measure that would bar him from making the state Capitol a gun-free zone without the approval of lawmakers. Efforts to tie his hands when it came to President Barack Obama’s signature health-care law were equally odious, he said, because of how central support for Obamacare, as the law is known, was to Democratic campaigns in Wisconsin.

“Both the attorney general and I ran on those issues. I said it 15 times every single day,” Evers said. Not following through on his promises, he reasoned, would be “hypocritical.”

Not just Democrats, he said, but all people who “respect Wisconsin’s democracy” should connect with their legislators.

“They have to speak up now,” Evers said.

This story has been updated.

More from Morning Mix:

How does #MeToo work when the accused is dead? This college found out.

Rudy Giuliani’s typo became an anti-Trump message. He blamed Twitter, but this Atlanta man pranked him.

Florida woman who failed to return home after her birthday trip to Costa Rica is confirmed dead