Wisconsin Supreme Court Justice Daniel Kelly, despite enthusiastic backing from President Trump ahead of last Tuesday's election – which coincided with the Democratic presidential primary in the state – lost a closely watched contest to hold onto his seat to liberal Judge Jill Karofsky in results released Monday.

Kelly's defeat in the race that drew nearly $5 million in spending and will put Karofsky on the Wisconsin Supreme Court for a 10-year term amounts to a rebuke of the Trump-backed candidate in a state that was key to Trump's 2016 presidential election victory and that Democrats are targeting as they hope to win back the White House in November. It also reduces the conservative majority in the Wisconsin Supreme Court to 4-3 with another conservative seat coming up for reelection in 2023.

Trump had called Kelly "tough on crime" and said he is doing a "terrific job" protecting the Second Amendment in one tweet endorsing the justice.

BIDEN PROJECTED WINNER IN WISCONSIN PRIMARY AFTER DELAYED RESULTS

"He has my Complete Endorsement," Trump said in a tweet.

Former Vice President Joe Biden won the Democratic presidential primary in Wisconsin, which was held before Vermont Sen. Bernie Sanders exited the presidential race, making Biden the presumptive nominee.

The Wisconsin election became a microcosm of a nationwide fight over mail-in ballots during the coronavirus crisis. Wisconsin Gov. Tony Evers lost in two consecutive legal challenges the day before the election as he attempted to move the date of the in-person election and to extend the deadline by which absentee ballots could be postmarked or turned in. Republicans in the legislature refused to work with Evers, a Democrat, saying that Evers did not come to them early enough, they had advocated for people to vote absentee anyways and people should have the option to vote in-person on election day.

NEW SALVO IN EXPANDING POLITICAL FIGHT OVER VOTE-BY-MAIL AS WISCONSIN RESULTS COME IN

Republicans nationwide have expressed concerns over expanded mail-in ballot programs, saying they could lead to voter fraud, while Democrats see it as the best way to maintain social distancing while still conducting elections as scheduled.

"House Speaker Nancy Pelosi, D-Calif., and former Vice President Joe Biden say we must throw election integrity to the wayside in favor of an all-mail election, fundamentally changing how Americans vote in eight months," RNC Chairwoman Ronna McDaniel wrote in an op-ed for Fox News. "The overhaul would vastly expand opportunities for fraud and weaken confidence in our elections, but all Washington Democrats see is a potential benefit for their party."

BIDEN'S GOAL OF UNITING DEMOCRATS WITH PROGRESSIVE SUPPORT FACES UNCERTAIN FUTURE DESPITE SANDERS ENDORSEMENT

Biden last week emphasized in a “Today” show appearance that it’s time to start looking into what it “would take to have voting by mail.”

Karofsky, in a Monday tweet, said the move to force in-person voting by the conservative-majority Wisconsin Supreme Court was aimed at driving down turnout to help Republicans win.

"The last minute decisions made last week to hold in-person voting were designed to suppress votes and support a political agenda," she said. "In-person voting should not have been held Tuesday."

As the vote-by-mail push continues to gain momentum, Virginia Gov. Ralph Northam over the weekend signed a bill allowing no-excuse absentee voting.

NY TIMES ELECTION ANALYST SAYS BIDEN LEAD OVER TRUMP 'NARROW AND TENUOUS', IF HE HAS LEAD AT ALL

Despite the win, Karofsky decried the fact many voters who did not get an absentee ballot in time for the election were forced to head to the polls.

"Although we were successful in this race, the circumstances under which this election was conducted were simply unacceptable, and raise serious concerns for the future of our Democracy," Karofsky said. "Nobody in this state or in this country should have been forced to choose between their safety and participating in an election."

Biden similarly panned the election's circumstances in a video he released thanking Wisconsinites for the electoral win.

CLICK HERE TO GET THE FOX NEWS APP

"It should have never come to that," Biden said of the in-person voting. "No one should ever have to choose between their health and our democracy. Instead, we saw Republicans willing to risk people's lives for their own political purposes, refusing to work with the governor to find an alternative solution to in-person voting last week."

Kelly congratulated Karofsky in a statement and called it an honor to have served on the court. He was first appointed to his seat in 2016 by former Wisconsin Gov. Scott Walker.

But the fight over mail-in voting is unlikely to stop after the release of Wisconsin's results. Trump has said "Republicans should fight very had when it comes to state wide mail-in-voting" and called it "[t]reasonous." Democratic National Committee Chairman Tom Perez, on the other hand, has said there is bipartisan support behind the proposal, the fight over which is likely to play out state-by-state in the run-up to November.

"Republican and Democratic governors have said vote by mail is not something that is going to lead to fraud," he told Politico Monday.

Fox News' Paul Steinhauser and The Associated Press contributed to this report.