The crowd at the victory speech of Senator Bernie Sanders of Vermont at Concord High School in Concord, N.H., on Tuesday night.Credit Todd Heisler/The New York Times

For those questioning whether the populist anger that was showing up in polls was being hyped by the news media, the results of the New Hampshire primary demonstrated otherwise. Donald J. Trump and Senator Bernie Sanders of Vermont, candidates from very different places — one a plutocrat, the other the son of a Polish immigrant who went to a Brooklyn public school — captured primary victories in the state.

Seven months ago, it would have been hard to conceive of such a result. Mr. Sanders was seen by some as a protest candidate who would not halt the Hillary Clinton march toward the nomination, and Mr. Trump was seen as a circus sideshow whose support was founded solely on name recognition. In Mr. Trump’s case, he outperformed some of the public opinion polls leading into New Hampshire, a feat for which he deserves credit.

The two New Yorkers will catapult out of New Hampshire with the wind at their backs. Mr. Sanders, a prodigious low-dollar fund-raiser, is almost certain to reap a windfall that will fuel his campaign for many months.

At her concession event, Mrs. Clinton delivered a different, more cohesive speech, one that sounded determined to move forward for what will be a long slog. While she was aware she would most likely lose in the state, the margin was still large, and she must regroup before the Democratic debate in Milwaukee on Thursday night. Her aides have said they believe her longstanding ties with black voters will aid her in South Carolina — but there had also been an assumption that her longstanding ties in New Hampshire would help her.

The Republican race seems destined to be confused and lacking clarity leading up to the July convention. The question remains as to how Mr. Trump will tailor his effort going forward. It is impractical and difficult to continue running everything on the fly. He has long craved electoral respectability, but the roots of his candidacy can be traced to May 2011, when President Obama, during his address at the White House Correspondents Dinner, put a picture of his Hawaiian birth certificate on a large screen.

Mr. Trump, who had insisted that there were questions about Mr. Obama’s true birthplace and spent weeks on the issue, sat in the center of the room at the dinner, surrounded by more than 2,000 people, all of whom laughed loudly at Mr. Obama’s gag. Mr. Trump sat still, watching from his chair. Five years later, he seems determined not to be humiliated again, and to stop those who laughed at him.

About First Draft

First Draft provides fast-paced and comprehensive coverage of politics and elections by The New York Times. Come back throughout the day for the latest news and analysis, and be part of the political conversation.