By KEN THOMAS and KATHLEEN RONAYNE, Associated Press

PORTSMOUTH, N.H. (AP) — With hugs and handshakes, Bernie Sanders endorsed Hillary Clinton for president on Tuesday and emphatically told his supporters their "political revolution" must now turn to electing his Democratic former rival.

Sanders bestowed his long-awaited support before a boisterous New Hampshire crowd, declaring he wanted to make it "as clear as possible as to why I am endorsing Hillary Clinton." He congratulated her for securing enough delegates to win the Democratic nomination and vowed to do everything he could to help her defeat Republican candidate Donald Trump.

"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," Sanders said.

He added: "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."

As Sanders delivered the endorsement just two weeks shy of the Democratic National Convention in Philadelphia, Clinton offered a huge smile, embracing him as they raised their arms in unity. The former secretary of state said the final four months of the campaign would be "much more enjoyable" working alongside Sanders and echoed her campaign slogan, "We are stronger together."

During much of her remarks, Clinton embraced many of Sanders' causes, vowing to oppose trade deals like the Trans-Pacific Partnership, fight to raise the federal minimum wage — adopting Sanders' tone, she called it a "starvation wage" — and overhaul the campaign finance system.

"These aren't just my fights. These are Bernie's fights. These are America's fights," Clinton said.

Sanders has vowed to continue on until the convention and even though he endorsed Clinton he is still an active candidate, his campaign said after the joint appearance. Spokesman Michael Briggs said Sanders still supports holding a roll call vote at the convention to determine the nomination.

Democrats have coalesced around Clinton's candidacy since she defeated Sanders in primaries last month in California and five other states, helped along by endorsements from President Barack Obama, Vice President Joe Biden and others. In a high-profile rally last month, Clinton was embraced by Massachusetts Sen. Elizabeth Warren, a liberal stalwart popular with Sanders' followers.

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. He called the platform "the most progressive" in history and hailed steps to create a $15 an hour minimum wage, prevent Wall Street malfeasance and address climate change.

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.

But James LePage, a 25-year-old teacher from Denver who attended the rally, said he felt Clinton was "genuine" in her remarks.

"I heard a lot of Bernie in her voice, which I wasn't willing to listen to before," LePage said.

Recent polls have shown that many Sanders voters plan to back Clinton but have reservations about her honesty.

A new GenForward poll of adults ages 18 to 30 found that Clinton was struggling to make inroads among young Americans who overwhelmingly supported Sanders. The poll found a majority of the nation's younger blacks and Asian-Americans have a favorable impression of Clinton, but the presumptive Democratic nominee struggles with whites and Hispanics.

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 generated 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.

In his remarks, Sanders warned that Trump was a divisive figure who would create further splintering.

"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 has courted Sanders' backers as the primaries have winded down, wasted little time going after Sanders, accusing him of capitulating to Clinton.

"Bernie Sanders, who has lost most of his leverage, has totally sold out to Crooked Hillary Clinton," Trump wrote on Twitter. "Sanders was not true to himself and his supporters."

___

Associated Press writers Catherine Lucey in Des Moines, Iowa, and Lisa Lerer in Washington contributed to this report.

___

On Twitter, follow Ken Thomas http://www.twitter.com/KThomasDC and Kathleen Ronayne https://twitter.com/kronayne