MANCHESTER, N.H. - Democratic presidential challenger Dean Phillips lost New Hampshire's primary election on Tuesday to President Joe Biden, who wasn't on the ballot but was a write-in choice for his supporters.

The Minnesota congressman had sought a strong finish to further make his case that Biden is too weak to defeat Trump again and force a reckoning for Democrats who've been backing the president. But Biden's support in New Hampshire on Tuesday was strong enough to overcome the challenge of not being listed on the ballot, with most voters writing him in.

As votes were counted and broadcast onto television screens at Phillips' election-night party, a sparse crowd of his family members and supporters waited, nearly outnumbered at times by members of the press. The Associated Press called the race for Biden just after 8 p.m. Eastern time.

Before results came in, Phillips said he hoped to win more than 20% support in New Hampshire's primary, a performance he believed could be a springboard for his long-shot campaign. As of Wednesday morning with nearly all votes counted, Phillips had won 19.6% of the vote.

"We've been at this for 10 weeks, my friends," Phillips told supporters at his election party. "We just earned 20% tonight and no one knew who we were."

Phillips' campaign had once set a target of winning 42% of the primary vote — the same total that former Minnesota U.S. Sen. Eugene McCarthy earned when he challenged President Lyndon B. Johnson in New Hampshire's Democratic presidential primary half a century ago.

John Libby, a 67-year-old Phillips supporter from Hooksett, said Tuesday night he thinks Biden isn't a "viable candidate" with many polls showing him trailing former President Donald Trump in a head-to-head matchup. But Libby said he thought Biden needed to perform under 60% for challengers such as Phillips to have a strong case. Biden was poised to win more than that as of 11:15 p.m. Eastern time.

Ever the optimist, Phillips deemed his performance Tuesday a victory and said the show must go on.

"You ready to keep this baby going?" he said to cheers.

The next Democratic presidential primary elections are in South Carolina, where Biden has a strong base of support, and then Michigan. Phillips and his campaign staff have said he will spend some time in South Carolina before its Feb. 3 primary but will focus most his efforts on Michigan, which votes Feb. 27.

Performing poorly in those states could make it difficult for Phillips to raise the money needed to continue. He told the Star Tribune that "no question, I will have to raise money to keep going."

"That, to me, is probably the only thing that will prevent me from continuing," Phillips said.

With Biden not on the ballot, New Hampshire might have been Phillips' best chance to upend the national election narrative. Phillips, author Marianne Williamson and more than a dozen other lesser-known candidates were on the state's Democratic primary ballot.

Biden chose not to appear on New Hampshire's ballot because the state defied the Democratic National Committee by holding its primary election before South Carolina's. The DNC reshuffled its order of state presidential primaries this year, placing South Carolina ahead of the historically first New Hampshire.

The winner of New Hampshire's Democratic presidential primary gained only momentum because the DNC deemed the contest unsanctioned and declared it wouldn't award any delegates.

Raymond Buckley, chair of the New Hampshire Democratic Party, said the strange circumstances of Tuesday's election made it unlike any in recent history.

"We have nothing to compare it to," Buckley said.

New Hampshire Secretary of State David Scanlan predicted late last week that more people would turn out for the state's Republican primary. He estimated voter turnout of 322,000 for the Republican contest and 88,000 for the Democratic primary.

The last time a Democratic president sought re-election in New Hampshire — Barack Obama in 2012 — about 62,000 voters cast ballots in the Democratic primary. Four years ago, about 300,000 people voted in the open Democratic primary.

At a polling place in Manchester early Tuesday, 37-year-old Erin Martin proudly cast a write-in vote for Biden, whom she praised as a strong leader who's made good progress. A mother of two girls, Martin said she's worried about the prospect of a second Trump presidency and feels safer with Biden in the White House.

"I feel terrified ... that as a country we'll lose our democracy, that women's rights will be completely taken away, that my daughters, it will trickle down to them eventually," Martin said. "It almost kind of chokes me up to think about it."

Phillips and his supporters briefly stood outside the Manchester polling location, thanking voters for participating in Tuesday's election regardless of who they supported. Not everyone was receptive.

When Phillips asked an older woman if he could say hello, she snapped back: "You may not. Biden all the way!"

Janet Poisson, on the other hand, was happy to support Phillips. The 48-year-old from Manchester said she thinks Americans "definitely need a change."

"Having another option to vote Democrat is wonderful, and our current president isn't even on our ballot," Poisson said, expressing frustration about Biden's absence from the primary.

In Derry, a town about 15 miles southeast of Manchester, 36-year-old Jon Turcotte posed for a picture with Phillips after voting for him. He said he likes that Phillips has the guts to speak up to the DNC.

"I like his policies," Turcotte said. "Based on the things he's been saying, he seems like a good candidate. I don't know how good his chances are."

Waving their candidates' signs outside the Derry polling place, some Biden and Trump supporters told Phillips they respected him after he came over to shake hands and give high-fives.

But some voters, such as Bill and Janice Burke, said they didn't know enough about Phillips and that his campaign started too late. They wrote in Biden's name Tuesday, saying they think the president is best positioned to beat Trump.

"I don't think Dean has enough steam," Bill Burke said.

Staff writer Josie Albertson-Grove contributed to this report.