Media captionNo-one more qualified for this office than Clinton, says Obama

In a highly significant move, a "fired up" President Obama took to the stage in North Carolina to offer his unequivocal backing to his former rival turned ally, Hillary Clinton. Pragmatic partnership has replaced the bitterness and distrust which characterised the 2008 presidential campaign.

They strode on stage under the banner "Stronger Together". They held hands, arms raised up high, in a sign of unity. She wore a vibrant fuchsia jacket, he was in a white shirt, his sleeves rolled up. They were "fired up, ready to go", ready to make their case for a Clinton presidency, one that would build on the Obama legacy.

It was the strongest moment yet in Hillary Clinton's campaign and a mesmerising image of two former rivals turned allies, their political destinies now deeply intertwined.

She spoke first, as he sat on a stool behind her. They paid tribute to each other, their work, leadership and most importantly for her, their character.

"He's a statesman, leading not just our country but the entire world," she said. The president later said: "My faith in Hillary Clinton has always been rewarded."

Neither Mrs Clinton nor the president addressed the controversy in their remarks, focusing on the unique and unlikely relationship they had forged.

"I have run my last campaign, but I am ready to pass the baton, and I know Hillary Clinton and I know she will run a good race," said Obama.

Media playback is unsupported on your device

Media captionHillary Clinton jokes about Trump's tweets about President Obama

The rally in a state that Mr Obama lost in 2012 but won in 2008 - and which Mrs Clinton is hoping to turn blue again in the fall - was their first together in this election cycle, and the moment when the relationship built on mutual respect and affection if not outright warmth had come full circle.

The event was a role reversal of their first joint appearance on the presidential trail of 2008, in Unity, New Hampshire on 27 June. Days after she had conceded defeat in the Democratic primaries, she hit the trail to campaign hard for her former rival, following a rancorous campaign that had left them and their aides deeply bruised.

In a debate in New Hampshire in January that year, Mrs Clinton was asked about persistent polls that showed she was not as likeable as then senator Obama. When she said this "hurts my feelings", Mr Obama dismissively said she "was likeable enough".

From Cincinnati, Ohio, Mrs Clinton took her rival to task about flyers that had been distributed discrediting her record on healthcare. "Shame on you Barack Obama," she said in a press conference.

All the bitterness and distrust built during the campaign meant that the evolution from rivals to working allies was not a given - it took a decision by both to move on.

The contrast with 2016 is telling. While Mrs Clinton became the presumptive democratic nominee on 7 June, her challenger, Senator Bernie Sanders, has yet to endorse her and is being increasingly criticised for being a sore loser.

"[Clinton and Obama] are both deeply pragmatic people, they're both extremely disciplined and they have a level of maturity that is unusual in politicians," said Mark Landler from the New York Times, and author of Alter Egos, a book on the relationship between the president and Mrs Clinton and their visions of American power.

They both had reasons to make peace. President Obama would have seen an advantage to having his key rival on his team, while Mrs Clinton understood that the best way to rebuild her political capital after her defeat was to be a good soldier.

But their entourage found it harder to let go of the campaign distrust, even after Mrs Clinton became secretary of state. There were concerns in the White House that Clinton would put her own agenda first; at the State Department, Clinton allies worried the president's entourage was keeping her on the sidelines.

A turning point came at a climate change summit in December 2009 in Copenhagen, when the president and the secretary of state stormed into a meeting of Chinese, Brazilian and Indian leaders who were trying to conceal their sideline negotiations from the Americans. The episode helped forge new trust between Mrs Clinton and Mr Obama.

While she was secretary of state, Mrs Clinton often cited her relationship with the president to foreign leaders as an example of politicians setting their differences aside for the good of country. She returned to that theme during her speech in Charlotte on Tuesday.

By the time she left the State Department, Mr Obama described her "as one of the finest secretaries of state we've had".

Today, whatever differences they may still have, much is at stake for both. Mrs Clinton made the calculation early on that she stood to benefit from reassembling the coalition of voters - including young and minority voters - which helped get Mr Obama get elected in 2008.

The president's approval ratings are at an all-time high of 53% - one of the key reasons why President Obama is the first incumbent in more than half a century to be eagerly embraced on the campaign trail by a potential successor.

Mr Obama has his own reasons for being eager to campaign for Mrs Clinton.

"[The president] realises that she's the necessary custodian of his legacy. If she doesn't get elected a lot of the things that he fought for are in danger and can be undone by the Republicans," said Mr Landler

Media playback is unsupported on your device

Media captionHillary Clinton tweeted President Obama's endorsement video in June

Mr Obama held off from endorsing Mrs Clinton until she clinched enough delegates to become the presumptive Democratic nominee when the final, big primaries were held on 7 June. When he did, his video message would have felt like the ultimate vindication for Mrs Clinton who still faces questions about her likeability today.

"She's got the courage, the compassion and the heart to get the job done. Even after our own hard-fought campaign, in a testament to her character, she agreed to serve our country as secretary of state," the president said in a video announcing his endorsement.

Mrs Clinton and Mr Obama will now engage in a very delicate dance, emphasising the issues they agree on and trying to skirt around those on which they don't.

On Syria, Mrs Clinton has recommended no-fly zones, which Mr Obama opposes. On Iran, Mrs Clinton will take a tougher stance on Tehran's regional ambitions. On trade, Mrs Clinton changed her mind about the Trans-Pacific Partnership agreement championed by the president.

The two will campaign mostly separately. Mrs Clinton will be wary of being outshined by a better campaigner than her, while Mr Obama will want to focus on those issues most important to him.

But on Tuesday, the president and his former secretary of state flew together with their aides on Air Force One to Charlotte, in a powerful reminder that his legacy and her political future are now tied in ways neither one of them could have foreseen during the cold days of the 2008 campaign trail in Iowa.