MADISON, Wis. — The liberal-controlled Wisconsin Supreme Court overturned Republican-drawn legislative maps Friday and ordered that new district boundary lines be drawn as Democrats had urged in a redistricting case they hope will weaken GOP majorities.

The ruling comes less than a year before the 2024 election in a battleground state where four of the six past presidential elections have been decided by fewer than 23,000 votes, and Republicans have built large majorities in the Legislature under maps they drew more than a decade ago.

The court ruled 4-3 in favor of Democrats who argued the legislative maps are unconstitutional because districts drawn aren’t contiguous. New maps are likely to be unveiled in about two months.

“Because the current state legislative districts contain separate, detached territory and therefore violate the constitution’s contiguity requirements, we enjoin the Wisconsin Elections Commission from using the current legislative maps in future elections,” Justice Jill Karofksy wrote for the majority.

Democratic Gov. Tony Evers hailed the ruling, saying he looks forward to submitting proposed maps for the court to review.

“And I remain as optimistic as ever that, at long last, the gerrymandered maps Wisconsinites have endured for years might soon be history,” he said.

Dan Lenz, an attorney for Law Forward, which brought the lawsuit, called the ruling “a victory for a representative democracy in the state of Wisconsin.”

“For too long, right wing interests have rigged the rules without any consequences,” he said in a statement. “Gerrymandered maps have distorted the political landscape, stifling the voice of the voters. It challenges the very essence of fair representation and erodes confidence in our political system.”

Republican Assembly Speaker Robin Vos called it “a sad day for our state” and suggested it will be appealed, saying the U.S. Supreme Court will have the final say.

The Wisconsin Supreme Court said it will proceed with adopting remedial maps in time for the 2024 election unless the Republican-controlled Legislature can pass maps that Evers will sign. Evers vetoed the current maps.

The court appointed two consultants who already had a hand in reshaping districts in other states.

Jonathan Cervas, of Carnegie Mellon University in Pittsburgh, redrew New York’s congressional and state Senate maps after a court struck down ones adopted by the Democratic-led Legislature. Bernard Grofman, of the University of California, Irvine, helped redraw Virginia’s federal and state legislative districts after a bipartisan commission deadlocked.

Conservative justices also objected to the hiring of the consultants, saying their selection, the legal authority to appoint them and their responsibilities all raise serious questions.

The maps from parties to the lawsuit are due by Jan. 12, with supporting arguments due 10 days later. Reports from the consultants are due by Feb. 1, with responses a week later. That means the court will release new maps likely sometime in late February or early March unless the Legislature acts first.

The state elections commission has said maps must be in place by March 15 if the new districts are to be in play for the 2024 election.

The lawsuit was filed a day after the court’s majority flipped to 4-3 liberal control in August. That’s when Justice Janet Protasiewicz joined the court after her April election victory.

Protasiewicz called the GOP-drawn maps “unfair” and “rigged” during her campaign, leading Republicans to threaten to impeach her before she had even heard a case. She sided with the other liberal justices in striking down the current maps.

Vos, who had threatened impeachment the loudest, backed off Wednesday and said, even if she ruled in favor of throwing out the maps, impeachment was “super unlikely.”

Protasiewicz joined with Karosfky and justices Ann Walsh Bradley and Rebecca Dallet in the majority. Conservative justices Annette Ziegler, Rebecca Bradley and Brian Hagedorn dissented.

All of the dissenting justices accused the majority of putting politics above the law.

“This deal was sealed on election night,” Ziegler wrote in her dissent. “Four justices remap Wisconsin even though this constitutional responsibility is to occur every 10 years, after a census, by the other two branches of government. The public understands this.”

She accused the majority of “judicial activism on steroids” and said “the court of four takes a wrecking ball to the law.”

Rebecca Bradley, in her dissent, referred to the liberal majority as “handmaidens of the Democratic Party,” saying they “trample the rule of law, dishonor the institution of the judiciary, and undermine democracy.”

Hagedorn called it “a sad turn for the Wisconsin Supreme Court.”

“Today, the court dives headlong into politics, choosing to wield the power it has while it has it,” he wrote. “Wisconsinites searching for an institution unpolluted by partisan warfare will not find it here.”

Wisconsin’s redistricting ruling comes one day after a federal judicial panel also struck down some of Michigan’s state House and Senate districts and ordered them to be redrawn. The Michigan court said the districts were illegally drawn based on race.

Wisconsin Democrats argued for having all 132 lawmakers stand for election under the new maps, including half of the members of the state Senate who are midway through their four-year terms.

But the court rejected the request from Democrats to invalidate the 2022 results, which would have forced all state Senate seats to be on the 2024 ballot.

In a significant win for Democrats, the court said it would not favor maps that have the least amount of change over existing boundary lines. The previous conservative-controlled court had adopted the “least change” approach for the maps adopted in 2022, which closely resembled the maps Republicans passed in 2011.

The court agreed with Democrats who argued in Wisconsin that the majority of current legislative districts — 54 out of 99 in the Assembly and 21 out of 33 in the Senate — violate the state constitution’s contiguity requirement.

Wisconsin’s redistricting laws, backed up by state and federal court rulings over the past 50 years, have permitted districts under certain circumstances to be noncontiguous, attorneys for the Legislature argued.

The legislative electoral maps drawn by the Republican-controlled Legislature in 2011 cemented the party’s majorities, which now stand at 64-35 in the Assembly and a 22-11 supermajority in the Senate.

Litigation is ongoing in more than dozen states over U.S. House and state legislative districts enacted after the 2020 census.