President Biden won the New Hampshire Democratic presidential primary on Tuesday, carried by his supporters’ write-in campaign after he declined to appear on the state’s ballot.

The victory, called by The Associated Press, was good, if expected, news for Mr. Biden. But votes were still being counted, and the final margin of his win will be closely watched.

As an incumbent president facing a list of long-shot challengers, anything short of a decisive victory would be perceived as bruising for Mr. Biden, even though he did not try to compete in the primary.

Mr. Biden skipped the state after a dispute over the timing of its primary, as he and the Democratic National Committee sought to push New Hampshire’s contest later in the nominating process. Granite Staters, deeply protective of their first-in-the-nation tradition, refused to comply.

His allies in the state eventually stepped in, and the write-in effort, supported by top Democrats there, generated the kind of grass-roots energy for Mr. Biden that has not yet materialized in other states — and that he did not enjoy in New Hampshire’s primary in 2020, when he came in fifth place.

“Despite President Biden’s absence from the ballot, Granite Staters still turned out in robust numbers to show their support for the great work that the Biden-Harris administration has done,” Ray Buckley, the chairman of the New Hampshire Democratic Party — and an ardent critic of the calendar changes — said in a statement, praising the success of the write-in campaign. “Once again, New Hampshire’s first-in-the-nation primary made history — and we are proud as ever.”

Before the vote on Tuesday, a memo from the Write-In Biden campaign emphasized the complex nature of the race and cautioned against drawing sweeping conclusions from the results.

“Write-in campaigns are very difficult, and Joe Biden’s vote total on Jan. 23 will understate his actual support among New Hampshire Democrats and independents,” the memo warned.

There are also signs that Democratic-leaning independents, who would most likely back Mr. Biden in the general election, participated in the state’s Republican primary to oppose former President Donald J. Trump.

Mr. Trump won his race anyway, defeating Nikki Haley on Tuesday, according to The Associated Press. Ms. Haley, the former governor of South Carolina, vowed to continue her campaign.

The Biden campaign did not comment directly on the outcome of New Hampshire’s Democratic primary. Instead, a statement from Julie Chávez Rodríguez, the campaign manager, signaled that the team was in general-election mode.

“Tonight’s results confirm Donald Trump has all but locked up the G.O.P. nomination, and the election-denying, anti-freedom MAGA movement has completed its takeover of the Republican Party,” she said. “Donald Trump is headed straight into a general election matchup where he’ll face the only person to have ever beaten him at the ballot box: Joe Biden.”

Still, Mr. Biden’s absence in New Hampshire left him exposed to a collection of opponents who had virtually no shot of winning the nomination but who saw an opportunity to win attention.

That group was led by Representative Dean Phillips, Democrat of Minnesota. Mr. Phillips, who pushed a message of generational change and denounced Mr. Biden, 81, as “unelectable,” spent heavily on advertising as he highlighted Mr. Biden’s snub of the state. One of his ads featured Bigfoot searching for the president.

He sought to tap into Democratic discontent with the president, which is abundantly evident in polling. Mr. Biden’s allies argue that when Americans focus more squarely on the election, especially on the prospect of another matchup against Mr. Trump, that sentiment will shift.

On Tuesday night, Mr. Phillips congratulated Mr. Biden at his watch party in Manchester, saying that the president “absolutely won tonight” — but, he added, “by no means in a way that a strong incumbent president should.”

The more consequential tests for Mr. Biden will come when he competes in the Democratic primary contests next month in South Carolina, Nevada and Michigan, three key states where the Biden campaign will have to show it can mobilize its most loyal voters. Amid concerns from Democrats about his campaign’s structure — and as his team gears up for a bruising general election swiftly coming into view — Mr. Biden approved a leadership shake-up that will see a top White House aide take over functional control of the re-election effort, The New York Times reported on Tuesday.

The drama over this year’s nominating calendar began in late 2022, when Mr. Biden and the Democratic National Committee decided to reorder it, saying that Democrats should give states with more racial diversity greater influence. Their plan put South Carolina first and would have pushed New Hampshire to second, alongside Nevada.

But New Hampshire Democrats, who pride themselves on the state’s longtime first-in-the-nation tradition — a matter of state law — balked, and the state was stripped of its delegates.

Ultimately, leading Democrats in the state put aside their vociferous criticism of the calendar overhaul to back the head of their party, even as they staunchly defended their primary tradition.

“It’s in our D.N.A. — it’s part of who we are,” said former Gov. John Lynch, Democrat of New Hampshire. “But also, I think there are Democrats, myself included, who are willing to sort of step back and say, you know, What’s the bigger picture?”

Anjali Huynh contributed reporting from Manchester, N.H.

Leave a Reply

Your email address will not be published. Required fields are marked *