PORTSMOUTH, N.H.—Sen. Bernie Sanders offered an unequivocal endorsement of Hillary Clinton on Tuesday, ending an intense intraparty rivalry amid signs that progressive holdouts are coalescing around the presumptive Democratic nominee for the fall showdown with Republican Donald Trump.

After a protracted duel that divided the Democratic Party between Mrs. Clinton’s centrist policy proposals and the Vermont senator’s more ambitious, left-leaning vision, Mr. Sanders threw his support to his Democratic rival, clearing the way for a unified front in the general-election campaign.

“I have come here to make it as clear as possible as to why I am endorsing Hillary Clinton and why she must become our next president,” Mr. Sanders told a crowd that blended supporters of both candidates. “This campaign is about the needs of the American people and addressing the very serious crises that we face. And there is no doubt in my mind that, as we head into November, Hillary Clinton is far and away the best candidate to do that.”

The show of Democratic unity officially concluded a 14-month fight between a little-known senator from Vermont and a former secretary of state who entered the race as a prohibitive favorite. Mr. Sanders, a self-described Democratic socialist who built a passionate following among younger voters, mounted a surprisingly fierce challenge. But in the end, he fell short of Mrs. Clinton by several million votes.

On Tuesday, the Democratic candidates returned to New Hampshire, where Mr. Sanders notched his first victory in the primary campaign. There, the Vermont senator delivered the words Mrs. Clinton had been waiting to hear: “She will be the Democratic nominee for president, and I intend to do everything I can to make certain she will be the next president of the U.S.,” he said.