MILWAUKEE (Reuters) – The Republican-controlled state Senate in Wisconsin approved legislation on Wednesday that would weaken the powers of the incoming Democratic governor and attorney general, voting in the early hours after debates that lasted through the night.

The state Assembly was expected to vote in favor of the measure later on Wednesday, after which it would go to current Republican Governor Scott Walker, who has indicated he would sign it. His successor, Democrat Tony Evers, has said he may mount a legal challenge to the measures.

Wisconsin’s lame-duck Republican-majority legislature called a rare post-election session this week to consider the proposals before Governor-elect Evers takes office in January and can exercise his veto power.

After an all-night session, lawmakers reconvened just before 5 a.m., with Democrats blasting the Republican majority for trying to grab power after they lost the governorship in elections on Nov. 6. That result ended years of complete Republican control of government in the state.

“Republicans are very sore losers,” said Senator Fred Risser, a Democrat. “You’re trying to undo what the voters have done.”

The Senate voted to pass the central piece of the legislation by 17 votes to 16, with only one Republican voting against it, according to results posted on the state legislature’s website.