THE classic 1950s Western, Shane, has one of the most memorable endings in the history of the genre. Having rid a small town of the bad guys, laconic gunslinger, Shane, rides out leaving behind eight-year old Joey Starrett, a local boy, who has come to idolise the quick draw of Shane.

It’s one of America’s most famous and poignant movie moments as the wounded Shane, slumped in the saddle, rides off towards the mountains. “Shane! Come back!” cries little Joey in vain as his hero disappears from his life and those of the homesteaders the dignified and effortlessly cool Shane had served.

Call me a sentimentalist, but I can’t help thinking that many Americans may just be about to experience their very own collective Joey Starrett moment as Barack Obama rides off into the political unknown.

“Obama! Come back!” might very well become the plaintive cry heard echoing across swathes of America and beyond in the coming months and years. That the “bad guys”, led by one President Donald Trump, have only just burst into the White House saloon, with a promise to shake things up, only adds to the dysphoria and uncertainty of the moment.

Even if it were possible for Mr Obama to return, not everyone would welcome it. There is simply no getting away from the fact that millions of Americans wanted Mr Trump to ride into their lives. As he becomes the 45th US president today, it seems only right to pause and reflect on this pivotal and perhaps unprecedented moment.

This transition is nothing new, of course. Presidents have come and gone many times in the past, but rarely, if ever, can there have been two such sharply contrasting characters passing the baton as US president. Back on January 20, 2009, when he was inaugurated, Mr Obama’s eloquence and dignity were evident from the start.

Here was a man who, when he spoke, left you in no doubt that he was moulded from the best of American values and traditions. Time and again, whether the observer agreed or disagreed with his politics, Mr Obama displayed a grace, class, intelligence and humour that rightfully won him plaudits and home and abroad.

Let’s not forget that, almost from the moment he was elected to office, he was dealt a serious of dud hands. Not only was the world facing the worst financial crisis since the Great Depression, but also the United States was mired in two unwinnable wars and the country’s bogeyman Osama bin Laden was still causing mayhem.

Barely a month into his term, Mr Obama was confronted with a country haemorrhaging jobs at a rate of 800,000 a month. Undaunted, he launched an $800 billion (£650bn) stimulus package, the largest in US history.

Facing challenges such as this, President Obama showed a measured demeanour and remarkable level of forbearance that were to become the hallmark of his presidency. This was a man big enough to be charitable toward most of his critics, despite the abuse and thinly veiled racism sometimes directed his way.

It’s for good reason that his nickname “No-drama Obama,” sticks to this day. Where once he rallied the American people with the cry, “Yes we can,” today Mr Trump divides them by insisting: yes you can, but only if I say so and it’s done my way. Doubters need only listen to his first post-election press conference, during which his hallmark delivery was full of blatant abuse, deception and bombast.

Where Mr Obama’s presidential administration was near scandal-free, Mr Trump, long before even becoming president-elect, was steeped in vulgarity and controversy. Like Shane, the anti-hero, not everything Mr Obama did was good of course; indeed, far from it. His biggest successes were on the domestic political front. He pushed through health care reforms. Thanks to his persistence, more than 20 million Americans who lacked health care coverage have it, for the present at least.

He will be remembered, too, for promoting greater tolerance toward minorities through legalisation for gay marriage. By any standards, given what he faced when taking on the presidency, these are no mean achievements. On the foreign policy stage his legacy is more of a mixed bag. Yes, he helped broker the crucial Iran nuclear deal. He got US troops out of Iraq and cut their numbers in Afghanistan as well as bringing down Osama bin Laden. Rapprochement with Cuba was a remarkable achievement, too.

But the Obama administration will also be remembered for mishandling the Arab Spring, especially in Libya, as it will also be for embracing and expanding aspects of the George W Bush “war on terror”. Never were so many drones and special operations forces deployed or targeted assassinations undertaken against suspected terrorists all over the world. Much of the US intelligence community, meanwhile, was let off the hook for past excesses. It was rarely reined in.

As Stephen M Walt, professor of international relations at Harvard University, recently pointed out, Mr Obama’s administration did not hold back on prosecuting whistleblowers and journalists, allowing, albeit unintentionally, Mr Trump to inherit “a set of tools he can use to suppress honest reporting if he wishes”. If the past few weeks are anything to go by, it’s a pretty safe bet he will do just that. Yes, there is a disparity between the promise of Mr Obama and what he has actually delivered. Recently, I was amazed to read about how poorly he appears to be regarded.

According to a Gallup approval rating, the only presidents since 1953 with a lower average score were Jimmy Carter and Gerald Ford. Indeed, if the poll’s findings are to be accepted, George W Bush was, overall, more popular. I for one don’t buy this and firmly believe history will judge Mr Obama as one of the great US leaders. While he will be remembered for being America’s first non-white president, there was so much more that he brought to his leadership worth marking down for the annals of history.

In these bleak Brexit days, what an antidote it would be to have someone of Mr Obama’s charisma and character in British politics. At his final White House Correspondents’ Dinner last year, his walk-on music was Anna Kendrick’s cover of the song Cups with its chorus line: “You’re gonna miss me when I’m gone.”

It was typical Barack Obama: subtle, modern, considered and tellingly irreverent. “You can’t say it,” he said, glancing around the room, “but you know it’s true.”

In the months to come, should many Americans feel they are undergoing their own Joey Starrett moment as Mr Obama rides off, it’s only understandable.

Just like Shane, though, for Mr Obama there can be no turning back. The citizens’ cries of “Obama! Come back!” can never be heeded. The Donald is in town.