MADISON, Wis. — The Wisconsin Senate voted early Wednesday to pass a sweeping measure designed to empower the Republican-controlled Legislature and weaken the Democrat replacing Republican Gov. Scott Walker.

Republicans worked through the night amid late protests, internal disagreement and Democratic opposition to the measures, which are designed to reduce the powers of incoming Democratic Gov.-elect Tony Evers and Democratic Attorney General-elect Josh Kaul.

Evers and Kaul urged Republicans not to approve the bills during the lame-duck legislative session, warning that lawsuits would bring more gridlock to Wisconsin when the new administration — and the first divided government in 10 years — takes over.

But Republicans forged ahead regardless, passing it 17-16 with all Republicans except one in support. All Democrats voted against it. The Assembly was expected to pass the bill later Wednesday, sending it on to Walker for his consideration. Walker has signaled support.

"This is a heck of a way to run a railroad," Democratic Senate Minority Leader Jennifer Shilling said as debate resumed at 5 a.m. "This is embarrassing we're even here."

In one concession, Republicans backed away from giving the Legislature the power to sidestep the attorney general and appoint their own attorney when state laws are challenged in court. An amendment to do away with that provision was part of a Republican rewrite of the bill, made public around 4:30 a.m. after all-night negotiations.

Walker, who was booed and heckled during an afternoon Christmas tree lighting ceremony in the Capitol rotunda, has signaled support for the measures that he would have to sign before they take effect. He's in his final five weeks as governor after losing a bid for a third term to Evers, the state schools superintendent.

Despite the victories by Evers, Kaul and every other Democrat running for statewide office, Republicans maintained majority control in the Legislature for the next two years. Democrats blamed partisan gerrymandering by Republicans for stacking the electoral map against them.

But faced with a Democratic governor for the first time in eight years, legislative Republicans came up with a package of lame-duck bills to protect their priorities and make it harder for Evers to enact his.

"Why are we here today?" Democratic Assembly Minority Leader Gordon Hintz said as the debate of more than nine hours began late Tuesday night. "What are we doing? Nothing we're doing here is about helping the people of Wisconsin. It's about helping politicians. It's about power and self-interest."

Assembly Speaker Robin Vos countered that the bills will ensure a balance of power between the Legislature and the executive branch.

"We have allowed far too much authority to flow to the executive," Vos said. "To you this is all about politics. To me, it's about the institution."

The bill would weaken the governor's ability to put in place rules that enact laws and shield the state jobs agency from his control until September. It would also limit early voting to no more than two weeks before an election, a restriction similar to what a federal judge ruled was unconstitutional. Democrats were optimistic it would be rejected by the courts again.

The proposal would also weaken the attorney general's office by requiring a legislative committee, rather than the attorney general, to sign off on withdrawing from federal lawsuits. That would stop Evers and Kaul from fulfilling their campaign promises to withdraw Wisconsin from a multi-state lawsuit seeking repeal of the Affordable Care Act. They made opposition to that lawsuit a central part of both of their campaigns.

The Legislature passed another measure to enact Medicaid work requirement rules Walker recently won a federal waiver to establish. The bill would also give the Legislature oversight over the governor seeking future waivers for health care, a change Democrats said would handcuff the new administration.

The proposals come after North Carolina lawmakers took similar steps two years ago. Michigan Republicans also are discussing taking action before a Democratic governor takes over there.

Protesters have come and gone in the Capitol the past two days as lawmakers rushed to pass the bills. The tumult was reminiscent of much larger demonstrations in the opening weeks of Walker's time as governor in 2011, when he effectively ended collective bargaining for most public workers.

"The first thing Scott Walker did when he walked through the door of the Capitol was to create chaos," Democratic Sen. Jon Erpenbach said during Senate debate. "The last thing he is doing is creating chaos."

