MADISON, Wis. (AP) — Joe Biden emerged victorious Monday in Wisconsin’s Democratic presidential primary, a turbulent election far more significant for the struggle over whether it should have been held at all last week amid the coronavirus pandemic.

Meanwhile, a liberal challenger declared victory over a conservative incumbent endorsed by President Donald Trump in a closely watched battle for a state Supreme Court seat, though The Associated Press hadn’t called the race.

Democrats have accused Republicans of forging ahead with Wisconsin’s election despite the coronavirus in the hopes it would dampen turnout in urban areas that were more likely to vote with the liberal court candidate, Jill Karofsky. The highly politicized court backed Republicans in proceeding with in-person voting in a ruling issued the day before the election.

Trump injected himself into the state Supreme Court race, breaking from health experts who have encouraged all Americans to stay home by calling on his supporters to “get out and vote NOW” for the conservative judicial candidate, Dan Kelly. He later said Democrats were playing politics by trying to postpone the election.

“As soon as I endorsed him, the Wisconsin Democrats said, ‘Oh, let’s move the election two months later,’” Trump said. “Now they talk about, ‘Oh, safety, safety.’”

Karofsky declared victory Monday evening as she Kelly with a little over half the vote counted.

Biden’s easy victory became academic after Vermont Sen. Bernie Sanders dropped out, one day after Wisconsin held in-person voting Tuesday despite widespread concern over the health risks. Republican legislative leaders refused to delay the election, and the party won a court battle to keep the date, making Wisconsin an outlier from other states that postponed spring primaries.

Earlier in the Democratic primary season, Wisconsin was seen as a potential battleground state especially given Sanders’ commanding victory there in 2016. But in the weeks before the election, Biden emerged as the front-runner as other challengers dropped out. Neither Biden nor Sanders campaigned in the state leading up to the vote due to the pandemic.

Returns weren’t allowed to be reported until Monday due to a quirk in the court battle over the election. Even before the counting began, a group of Milwaukee-area voters filed a federal lawsuit seeking to force a partial revote to protect the “thousands” of voters who they argue were disenfranchised by the turbulent election. Other lawsuits seemed certain to follow.

Thousands of voters congregated for hours in long lines on April 7, defying social-distancing guidelines that led to the postponement of primaries in several other states. The U.S. Supreme Court decided on the eve of the election that absentee ballots, requested in record numbers, had to be postmarked by midnight April 7. That overturned a judge’s ruling that had granted a one-week extension, forcing many residents to weigh safety concerns against exercising their right to vote.

Gov. Tony Evers, a Democrat, said Monday before votes were tabulated that the election was “a mess that could have been avoided.”

With a lawsuit filed Monday related to the election, and more expected, Evers said, “At the end of the day this will be resolved in court and then we can move on.”

The Wisconsin election crystallized what’s expected to be a high-stakes, state-by-state legal fight over how citizens can safely cast their ballots if the coronavirus outbreak persists into the November election. Democrats are arguing for states to be ready to shift to much greater use of absentee and mailed ballots, while Republicans are raising the specter that such elections could lead to increased fraud.

Many voters complained that they had requested absentee ballots that never arrived, forcing them to choose between sitting out the election or risking infection by voting in person. City officials in Milwaukee, as well as Wisconsin’s two U.S. senators, called on the U.S. Postal Service to investigate the complaints.

The Milwaukee-area voters who filed suit Monday said they could not vote because they had health concerns, problems with the absentee process, or submitted an absentee ballot that didn’t meet the April 7 deadline. Their lawsuit seeks class-action status and a court order to count the votes for others like them.

Separately, Milwaukee’s election commission voted Monday to count at least 390 absentee ballots that arrived without a postmark, had an illegible postmark or had a postmark with no date, the Milwaukee Journal Sentinel reported. Election clerks around the state were wrestling with the same problem, with lawsuits expected to resolve the question. Wisconsin election law had no postmark requirement prior to the Supreme Court ruling injecting one for this election.

Ahead of Monday’s returns, Democrats called on the Republican-controlled Legislature to move Wisconsin’s May 12 special congressional election to an all-mail affair. That’s unlikely given the Legislature’s unwillingness to shift last week’s election, but Evers has said he is considering moving the date which he’s already postponed once prior to the COVID-19 outbreak. Rep. Sean Duffy, a Republican, vacated the seat by retirement last year.