Dane County Circuit Judge Jill Karofsky defeated conservative Justice Dan Kelly to win a 10-year term on the Wisconsin Supreme Court in results released Monday from last week’s chaotic spring election.

The race was officially nonpartisan, but the high court has become heavily politicized in recent years. Liberal groups poured more than $2.4 million into the race for Karofsky, while conservatives spent more than $2.5 million for Kelly — who also drew President Donald Trump’s endorsement.

Karofsky’s victory narrows the court’s conservative majority to 4-3 and gives liberals a shot at seizing control when the next seat comes open in 2023.

Karofsky spent most of the campaign on the offensive, accusing Kelly repeatedly of being corrupt for consistently siding with conservative groups that come before the court. Kelly accused Karofsky of slandering him, and the court’s other conservatives questioned her ethics.

Wisconsin was the only state with an April election that didn’t postpone it to protect voters and poll workers from the coronavirus. Democratic Gov. Tony Evers issued a last-minute order on April 6 postponing in-person voting to June but the state Supreme Court struck the order down within hours. Kelly recused himself from that decision because he was running.

The election went on as planned on April 7. But the shifting deadlines forced many voters to decide between sitting the election out or venturing to the polls to cast their ballots in-person and risk contracting the virus.