PORTSMOUTH, N.H. (AP) — Bernie Sanders, whose calls for a political revolution energized millions of voters, bestowed his long-awaited endorsement on Hillary Clinton Tuesday, the Democratic former rivals embracing and praising each other before a cheering crowd of thousands.

Just two weeks shy of the Democratic National Convention, Sanders, a self-described democratic socialist, congratulated Clinton for winning the nomination and vowed to do everything he could to help her beat presumptive Republican nominee Donald Trump.

“It is no secret that Hillary Clinton and I disagree on a number of issues — that’s what this campaign has been about,” Sanders said.

But he added, “This campaign is not really about Hillary Clinton or Donald Trump or Bernie Sanders, or any other candidate who sought the presidency. This campaign is about the needs of the American people and addressing the very serious crises that we face.”

With a huge smile, Clinton embraced Sanders and they raised their arms in a traditional unity pose.

Clinton told the crowd, which included some Sanders supporters who have been slow to come to Clinton’s side, that she was overjoyed to welcome “friends, old and new.” She echoed her campaign slogan, telling the crowd “we are stronger together.”

With the convention approaching, Sanders said there has been a significant coming together between the two campaigns and we produced, by far, the most progressive platform in the history of the Democratic Party. Our job now is to see that platform implemented by a Democratic Senate, a Democratic House and a Hillary Clinton president – and I am going to do everything I can to make that happen.”

Democrats have coalesced around Clinton’s candidacy since she defeated Sanders in primaries last month in California and five other states, led by endorsements from President Barack Obama, Vice President Joe Biden and others.

Sanders has spent the past month seeking to influence the party’s platform for the Philadelphia convention and promote electoral reforms including allowing independents to participate in future primaries. The platform includes many of his proposals, including a $15 an hour minimum wage, tougher restrictions on Wall Street and an end to the death penalty.

The event at a Portsmouth high school sought to project Democratic unity before Republicans formally nominate Trump next week in Cleveland but some Sanders’ supporters in the crowd did not appear to be ready to move on.

Chants of “Bernie” broke out in the gymnasium while opening speakers addressed the crowd, prompting Clinton’s faithful to chant, “Unity.” When Sen. Jeanne Shaheen, a Clinton supporter, told the audience, “We need to elect Hillary,” some Bernie supporters stood and shouted, “No,” which was followed by chants of “Hillary” in the crowd.

“It’s like he’s giving up if he endorses her,” said Steve Rand, a hardware store owner from Plymouth, New Hampshire, before the two candidates took the stage. He added: “She stands for everything that I am against.

The Vermont senator saw his longshot bid for the White House quickly catch fire in 2015 at large-scale rallies where he denounced income inequality, the influence of Wall Street and the role of big money in politics — all part of a system he described as “rigged.”

Sanders was powered by an impressive online fundraising machine that raised more than $200 million and threatened Clinton’s once overwhelming lead in the Democratic primaries with the help of college students, independents and white voters drawn to his anti-establishment message. His endorsement could help bring some of those supporters into the fold for Clinton as she faces Republican Donald Trump.

“In these stressful times for our country, this election must be about bringing our people together, not dividing us up,” Sanders said. “While Donald Trump is busy insulting Mexicans, Muslims, women, African Americans and veterans, Hillary Clinton understands that our diversity is one of our greatest strengths.”

Trump, who previously said Sanders has been “treated terribly by the Democrats” and should have run as an independent, wasted no time going after the Vermont senator.

“Bernie Sanders, who has lost most of his leverage, has totally sold out to Crooked Hillary Clinton,” Trump wrote Tuesday as part of a series of Tweets ahead of the Portsmouth event. “Sanders was not true to himself and his supporters.”

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

WBZ NewsRadio 1030’s Bernice Corpuz reports