A liberal challenger easily defeated the conservative incumbent for a seat on the Wisconsin Supreme Court, a key race at the heart of Democratic accusations that Republicans risked voters’ health and safety by going forward with last week’s elections amid the coronavirus pandemic.

Jill Karofsky beat Daniel Kelly, whom then-Gov. Scott Walker (R) appointed to the state’s high court in 2016. Trump endorsed Kelly and on Election Day urged Wisconsin voters “to get out and vote NOW” for the justice.

With 99 percent of returns counted, Karofsky led Kelly by more than 163,000 votes, or nearly 11 percentage points — a substantial victory for Democrats in a state expected to be a key battleground in November.

The contest prompted a rancorous partisan debate over whether to proceed with in-person voting April 7, which Democrats opposed and Republicans supported. It was also hard-fought because of potential implications in the November presidential election, with a judicial decision about whether to purge the state’s voter rolls hanging in the partisan balance of the court.

Gov. Tony Evers (D), state health officials and local election officials had urged the Republican-led state legislature to postpone the election, but lawmakers refused, citing the risk of confusion and widespread vacancies in thousands of municipal seats on the ballot with terms due to expire in April.

Democrats accused Republicans of trying to take advantage of the likely low turnout resulting from fear of infection and closed polling locations.

The election featured snaking lines in Milwaukee and Green Bay, the result of mass cancellations by poll workers and the closure of polling locations. In Milwaukee, election officials opened just five voting locations, instead of the typical 180.

“Tonight, not just Jill Karofsky but democracy prevailed over a politically cynical strategy to weaponize the coronavirus pandemic as a tool of voter suppression,” said Ben Wikler, chairman of the Wisconsin Democratic Party.

Kelly conceded the race Monday night. “It has been the highest honor of my career to serve the people of WI on their Supreme Court these past four years,” Kelly said in a statement. “Obviously I had hoped my service would continue for another decade, but tonight’s results make clear that God has a different plan for my future.”

Democrats took Republican lawmakers to court to postpone the election and allow ballots to be mailed after Election Day, but the U.S. Supreme Court blocked the effort. Evers, meanwhile, issued an executive order postponing the election, only to be struck down by the conservative-majority state Supreme Court.

One lower-court ruling did stand, however — that the results would not be issued until Monday, after local election officials had time to receive and count the surge of absentee ballots mailed this year.

Scott L. Fitzgerald, the Republican majority leader in the Wisconsin Senate, told reporters last year that Kelly would have a “better chance” of winning a new term with lower turnout — a statement that fueled accusations from Democrats as to why Republicans wanted to go forward with last week’s elections.

But heavy mail-in balloting may have upended assumptions about relative advantage; according to statistics issued Monday by the state Elections Commission, nearly 1.1 million Wisconsinites cast ballots that way, nearly as many as total turnout in last year’s Supreme Court race — and more than the total turnout in the court races in each of the previous two years.

Wikler said GOP maneuvering could ultimately prove to be a miscalculation, especially if a spike in coronavirus infections becomes apparent in the coming days that can be attributed to in-person voting last week.

“In the months to come, most Americans might know someone who is hospitalized or has died of covid-19,” he said. “What seems like a cynically clever gambit to win election before a wave of deaths will feel morally bankrupt to most Americans by the time we arrive at November.”

Republicans entered the election with a 5-2 majority on the state Supreme Court, meaning that a Democratic victory still leaves liberals in the minority until 2023, the next time a conservative justice will face voters.

But an ongoing legal battle over a voter roll purge raised the stakes of this year’s election, with implications for November. Kelly recused himself, and conservative Justice Brian Hagedorn sided with voting rights groups to halt the purge. That left the court deadlocked 3-3 and gave Democrats a shot at stopping the purge, one of their top priorities ahead of the 2020 election.

Trump campaign spokesman Tim Murtaugh said in a statement that Kelly suffered from Sen. Bernie Sanders (I-Vt.) still being on the ballot and from Evers’s late-breaking decision to try to postpone the election.

“In November against hapless Joe Biden, President Trump will win Wisconsin again, as he did in 2016,” Murtaugh said.

The Republican National Committee congratulated the president for winning the state’s uncontested Republican presidential primary but made no mention of the court race.

Top Democratic strategists, meanwhile, said the chaos in Wisconsin highlighted the need for additional voter protections before November’s vote.

“Last week, Republicans did everything they could to prevent Wisconsin voters from participating in the election,” said Marc Elias, a D.C.-based Democratic elections lawyer. “The RNC literally went to the U.S. Supreme Court to try to stop the counting of mailed ballots. If they were willing to do this to win a state supreme court seat, imagine what they will do in November.”

Former vice president Joe Biden beat Sanders in the Wisconsin Democratic primary. Sanders dropped out of the race the day after the Wisconsin vote and endorsed Biden earlier Monday.

In 2016, Sanders decisively won the Wisconsin primary, carrying seven of the state’s eight congressional districts. He also scored an upset victory in Michigan and landslide win in Minnesota’s caucuses.

Sanders’s strength in those states last cycle became part of his argument that he could beat Trump. But the Vermont senator had been struggling in Midwest primaries this year, and a looming loss in Wisconsin helped him decide to end his campaign.