Former President Barack Obama on Tuesday formally endorsed Joe Biden – his vice president and running mate through two terms and presidential campaigns – in the looming race against President Trump, stepping off the sidelines after withholding support for any candidate for months.

Obama made the announcement in a statement and video posted on social media.

SANDERS ENDORSES BIDEN AFTER DROPPING BID

“Choosing Joe to be my vice president was one of the best decisions I ever made, and he became a close friend. And I believe Joe has all the qualities we need in a president right now,” Obama said.

Pointing to the severe challenges the nation faces as it copes with the coronavirus pandemic, the former president said that “Joe has the character and the experience to guide us through one of our darkest times and heal us through a long recovery. And I know he’ll surround himself with good people – experts, scientists, military officials who actually know how to run the government and care about doing a good job running the government."

And Obama stressed that Biden's a stronger presidential contender after surviving an historic primary field that peaked at some 25 White House hopefuls.

“Now Joe will be a better candidate for having run the gauntlet of primaries and caucuses alongside one of the most impressive Democratic fields ever. Each of our candidates were talented and decent, with a track record of accomplishment, smart ideas, and serious visions for the future," the former president noted.

Biden, reacting to the backing of his former boss, tweeted: "Barack — This endorsement means the world to Jill and me. We’re going to build on the progress we made together, and there’s no one I’d rather have standing by my side."

Obama’s past reluctance to back Biden even as the former vice president came closer to the nomination had raised awkward questions about their relationship, but those close to the former president had suggested he was keeping his distance so as not to meddle in the primary process.

President Trump’s re-election campaign manager Brad Parscale argued that “Barack Obama spent much of the last five years urging Joe Biden not to run for president out of fear that he would embarrass himself. Now that Biden is the only candidate left in the Democrat field, Obama has no other choice but to support him.”

A Democratic strategist close to Obama’s inner circle told Fox News last week that "at the beginning of the primary process, President Obama made clear that in order for the Democratic Party to be successful in November, Democratic voters would have to select their nominee."

But now that Biden is the presumptive Democratic nominee, Obama is entering the political ring anew.

The source emphasized that the former president made it clear at the start of the primary process that once it was over, he would “campaign vigorously in the general election.”

The video comes a day after Sen. Bernie Sanders, who was Biden’s last remaining primary rival until he dropped out last week, officially endorsed the former vice president.

The backing by Sanders -- the democratic socialist firebrand from Vermont -- will help Biden as he tries to win over Sanders' legions of younger and progressive supporters.

Fox News confirmed recently that Obama and Biden have held several conversations in the past couple of weeks. And Biden gave details on one of those conversations – telling donors at a virtual fundraiser earlier this month that he had recently asked his old boss for advice on choosing a running mate.

“So I called President Obama, not as to who but how soon you have to start,” the former vice president shared.

SANDERS SUSPENDS CAMPAIGN

The backing by Obama will also help Biden as he tries to unite a fractious party, as he prepares to challenge Trump in the general election. According to most recent polls of the former president, Obama remains extremely popular among Democrats.

Obama, Biden, Sanders, and Democratic Party leaders are all trying to avoid a repeat of the 2016 election, when Sanders endorsed nominee Hillary Clinton in July of that year after a long and bitter primary battle. But plenty of his supporters either stood on the sidelines or voted for a different candidate in November, helping Trump to upset Clinton and win the White House.

“Now that the primary season is over, President Obama can play the role of unifier-in-chief within the Democratic Party,” said Mo Elleithee, the founding executive director of Georgetown University's Institute of Politics and Public Service and a Fox News contributor.

Elleithee, a senior spokesman for Hillary Clinton’s 2008 presidential campaign who later served as communications director for the Democratic National Committee, said that Obama’s also “an important voice during these tumultuous times. As polling shows that President Trump’s handling of this crisis is sliding, President Obama can help make the case for Joe Biden’s very different approach.”

Obama’s presence will likely also come in handy with fundraising and give a needed boost of energy to the Biden campaign.

While political pundits agree that an active Obama can only help Biden as well as down-ballot candidates this autumn, in the end there’s only so much a surrogate can do. Obama aggressively stumped for Clinton, but the Democratic nominee came up short.

Fox News' Jon Decker, Madeleine Rivera, and Allie Raffa contributed to this report.