Barack Obama is preparing to go head to head with Donald Trump, as he hits the campaign trail in support of Democratic candidates in the upcoming midterm elections.

While neither man’s name will be on any ballot in November, both will be the star attractions for their respective parties, as they seek to use their popularity and fame to help push candidates over the winning line.

And while supporters of each will thrall to the differences between the two - Mr Trump’s off-the-cuff, nationalist bravura, and his predecessor’s more measured, multilateral inclusiveness - both men have the ability to excite and energise an audience.

“I think what will be very interesting is to see what Obama says on immigration, after what has been happening at the border,” Juliette Kayyem, a senior official in the Department of Homeland Security during Mr Obama’s first term, told The Independent.

“I think he will be say that Democrats can be tough on immigration without being cruel.”

Mr Obama this week released a list of 81 candidates - which his office said would be the first batch of several - he is backing for 2018.

“I’m proud to endorse such a wide and impressive array of Democratic candidates - leaders as diverse, patriotic, and big-hearted as the America they're running to represent,” he said in a statement.

“I’m confident that, together, they’ll strengthen this country we love by restoring opportunity, repairing our alliances and standing in the world, and upholding our fundamental commitment to justice, fairness, responsibility, and the rule of law. But first, they need our votes.”

Barack Obama and Joe Biden have lunch at Dog Tag Bakery

Among the candidates were several people who served either in his administration or his campaign. Around half were candidates for state legislatures, something on which the 44th president has been focussing since he left office in January 2017.

So far, the former president has steered clear of some of the more contentious races; he did not immediately endorse Alexandria Ocasio-Cortez, the Democratic left’s latest star, who recently defeated longtime congressman in the primary contest for New York’s 14th congressional district.

Neither did he weigh in on New York’s race for governor, where incumbent Andrew Cuomo faces a progressive primary challenge from Sex and the City actress Cynthia Nixon.

Among the names he backed for governorships were Jared Polis of Colorado, Gavin Newsom of California, Stacey Abrams of Georgia, Richard Cordray of Ohio and JB Pritzker of Illinois.

Mr Obama’s office said the list was heavy on young and diverse state-level Democrats because the former president “hopes to help current and aspiring Democratic leaders establish themselves, build their profiles, and lead their communities”.

It also said he would try and help the party retake the House of Representatives. Democrats need to flip 23 seats if they are to secure the lower chamber of Congress, which is the place where any impeachment effort of Mr Trump would begin.

The former president has admitted that during his two terms in office, the party failed to properly address defeats in state legislatures and governors’ mansions across the country.

His office said he would be campaigning for some of the candidates he has endorsed, without specifying which or where. Both his office and that of the Democratic National Committee did not immediately respond to enquiries on Thursday.

The announcement followed a move by former first lady Michelle Obama’ who said last month she would help help lead When We All Vote, a non-partisan, not-for-profit group working to help register new voters.

Mr Trump has already been busy campaigning ahead of election day, with recent rallies in Florida, Montana and Iowa. On Thursday night, he was holding a so-called ‘Make America Great Again’ rally in Pennsylvania.

Barack Obama's best moments in the White House Show all 11 1 /11 Barack Obama's best moments in the White House Barack Obama's best moments in the White House May 19, 2009 “The President was leaving the State Floor after an event and found Sasha in the elevator ready to head upstairs to the private residence. He decided to ride upstairs with her before returning to the Oval Office,” Peter Souza Barack Obama's best moments in the White House Oct. 26, 2012 President Barack Obama pretends to be caught in Spider-Man's web as he greets the son of a White House staffer in the Outer Oval Office Peter Souza Barack Obama's best moments in the White House “A National Security staffer, Carlton Philadelphia, brought his family to the Oval Office for a farewell photo with President Obama. Carlton’s son, Jacob, softly told the President he had just gotten a haircut like President Obama, and asked if he could feel the President’s head to see if it felt the same as his.” Peter Souza Barack Obama's best moments in the White House March 21, 2010 The President, Vice President and senior staff applaud after watching on television the House vote on H.R. 4872 for health care reform, in the Roosevelt Room of the White House Peter Souza Barack Obama's best moments in the White House Dec. 3, 2009 President Barack Obama fist-bumps custodian Lawrence Lipscomb in the Eisenhower Executive Office Building following the opening session of the White House Forum on Jobs and Economic Growth Peter Souza Barack Obama's best moments in the White House Sept. 22, 2015 "The Obama family and Biden family greet Pope Francis as he arrives in the United States for the first time at Joint Base Andrews," Sept. 22, 2015. Peter Souza Barack Obama's best moments in the White House Feb. 21, 2014 President Barack Obama and Vice President Joe Biden participate in a "Let's Move!" video taping on the Colonnade of the White House, Feb. 21, 2014 Peter Souza Barack Obama's best moments in the White House Feb. 18, 2016 President Barack Obama watches First Lady Michelle Obama dance with 106-Year-Old Virginia McLaurin in the Blue Room of the White House prior to a reception celebrating African American History Month, Feb. 18, 2016 Peter Souza Barack Obama's best moments in the White House Jan. 21, 2013 "The President and First Lady wave to supporters as they ride in the inaugural parade. I had asked the President if I could ride in the presidential limousine and the President joked, 'But Michelle and I were planning to make out," Jan. 21, 2013. Peter Souza Barack Obama's best moments in the White House Barack Obama and former First Lady Michelle Obama share a private moment in a freight elevator at an Inaugural Ball, January 2009 all pics: Pete Souza Barack Obama's best moments in the White House Barack Obama rests his hand on the bible that President Lincoln used for his swear-in, being held by his wife Michelle Obama as he is sworn in as the 44th President of the United States of America Rex

He has also been busy endorsing Republican candidates and claiming credit for those who have won their primaries, among them congresswoman Martha Roby who last month easily defeated a primary challenge from Bobby Bright.

“My endorsement came appropriately late, but when it came the ‘flood gates’ opened and you had the kind of landslide victory that you deserve,” Mr Trump wrote on Twitter. “Enjoy!”

Republicans sought to shrug off Mr Obama’s involvement, saying that Democrats had lost nearly 1,000 political offices around the country under his leadership and then lost the White House in the 2016 presidential election.

“No one’s more to blame for how weak today’s Democratic Party is than President Obama,” said Republican National Committee spokesman Michael Ahrens, according to Reuters.

But polls suggest Mr Obama retains considerable star power, 18 months after he left the White House.

Last month, the Pew Research Centre revealed the findings of a survey which asked people to name who they thought did the best job as president in their lifetime. Mr Obama was the top choice on 44 per cent, ahead of Bill Clinton on 33 per cent and Ronald Reagan on 32 per cent. Mr Trump was placed fourth with 19 per cent.

While Mr Trump has frequently criticised Mr Obama and accused his administration of illegally bugging his campaign during the 2016 White House race, Mr Obama has, as has been the convention for former presidents, been all but silent about the man who succeeded him - something that has angered many in the party.