US senator Bernie Sanders has endorsed former presidential rival Hillary Clinton as the Democratic nominee ahead of the party's convention later this month.
"Secretary Clinton has won the Democratic nominating process," Mr Sanders said to cheers in Portsmouth, New Hampshire.
"And I intend to do everything I can to make certain she will be the next president of the United States."
Five weeks after Mrs Clinton clinched the Democratic presidential nomination, the Vermont senator ended his campaign and joined her at the rally, to put their bitter primary battle behind them.
"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," he said.
Mr Sanders' endorsement brought the most prominent holdout in the party's liberal wing into Mrs Clinton's camp less than two weeks before the opening of the Democratic National Convention in Philadelphia, where she is expected to become the party's nominee.
Mrs Clinton hopes the joint appearance will help her win over Mr Sanders' supporters, some of whom carried Sanders signs into the rally and frequently drowned out her supporters.
"I can't help but reflect on how much more enjoyable this election will be now that we are on the same side," she said of Mr Sanders, "Thank you, Bernie, for your endorsement, but more than that, thank you for your lifetime of fighting injustice."
Together, let’s go win this election. pic.twitter.com/lRSwpk9y4b
— Hillary Clinton (@HillaryClinton) July 12, 2016
In recent Reuters/Ipsos polling, only about 40% of Mr Sanders' backers said they would back Mrs Clinton.
Meanwhile, the Trump campaign issued a statement saying Mr Sanders became part of a "rigged system" by endorsing Mrs Clinton.
"Bernie's endorsement becomes Exhibit A in our rigged system - the Democrat Party is disenfranchising its voters to benefit the select and privileged few," said Stephen Miller, a senior policy adviser to Mr Trump.
The appearance in Portsmouth concluded weeks of negotiations between the two camps as Mr Sanders pressed for concessions from Mrs Clinton on his liberal policy agenda.
It came after Mrs Clinton last week adopted elements of Mr Sanders' plans for free in-state college tuition and expanded affordable healthcare coverage. Mr Sanders also successfully pushed to include an array of liberal policy positions in the Democratic platform, which a committee approved on Saturday.
Mr Sanders did not win all of his policy fights, most notably failing to win support for blocking a vote in Congress on the Trans-Pacific Partnership trade deal.
But he told the rally in Portsmouth that "our job now is to see that platform implemented by a Democratically controlled Senate, a Democratically controlled House and a Hillary Clinton presidency - and I am going to do everything I can to make that happen."
"I think all signs point to the fact that we're going to have a very united party going into Philadelphia," Clinton campaign spokesman Brian Fallon said on CNN earlier, "and when you compare it to the Republicans, we're going to be miles ahead of them."
Mr Trump has struggled to unify the Republican Party after alienating many establishment figures with his stances on immigration, Muslims and women.
A number of prominent Republicans are skipping the party's convention in Cleveland next week.
In another sign of the Democrats' growing unity, two prominent liberal groups that had backed Mr Sanders, the Communications Workers of America trade union and the Congressional Progressive Caucus PAC, announced their support for Mrs Clinton yesterday.