(Bloomberg) -- President Joe Biden fended off a challenge from within his own party in New Hampshire, defeating Representative Dean Phillips in a race seen as a referendum on his ability to beat Republican Donald Trump in November. 

With 39% of votes counted, Phillips had only 20.5% of the vote, an extraordinary victory for the president as a write-in candidate. 

The victory will help quell calls for Biden, 81, to pass the torch to a younger Democrat.

Phillips, a Minnesota congressman serving his third term, launched his White House bid out of frustration with the prospect of a Trump-Biden rematch that could return the 77-year-old Republican frontrunner to the White House. 

Intra-party insurgencies are rarely successful at the presidential level, but can weaken the incumbent. Biden allies set low expectations for his performance in the state, saying write-in campaigns are always challenging. But Phillips had said anything less than 80% would be historically low for an incumbent president seeking reelection. 

Biden didn’t campaign in the state, citing new Democratic party rules that prohibit contests from awarding any delegates before the South Carolina primary Feb. 3. South Carolina helped deliver the Democratic nomination to Biden in 2020, and he supported the move to make the state the first official step in the party’s nomination process.

Phillips, 55, has used Biden’s refusal to play in New Hampshire’s primary to his advantage, campaigning heavily across the state and airing an ad comparing Biden to an elusive Bigfoot-like creature.

His bid has drawn interest from prominent Wall Street executives, including billionaire Bill Ackman of Pershing Square Capital Management and Mike Novogratz, the chief executive officer of crypto currency firm Galaxy Investment Partners.

Ackman’s endorsement of Phillips has undergone scrutiny in recent days after the Minnesota Democrat removed a section of his website that addressed diversity, equity and inclusion efforts, or DEI. Ackman, who is most known as an activist investor, has sought to get rid of DEI programs.

Phillips, a multimillionaire who built the Talenti gelato brand, has self-funded much of his campaign. 

©2024 Bloomberg L.P.