So Europe’s first great love affair of the 21st century is over. Knowing that it could only last eight years kept almost every one of them special. Barack Obama’s approval ratings in France and Germany approach 90%. Almost every trip across the Atlantic turned into a memory to be treasured, except perhaps for the Poles, some of whom resent being reminded that Nato is an institution intended to preserve European democracy against internal as well as external threat. Even in the UK last summer, after that ill-judged appearance with David Cameron at the Foreign Office, when the president warned that a post-Brexit Britain would go to the back of the trade deal queue, nearly 80% of Britons still loved him.

Now his memory will be flattered, it seems, by the arrival of Donald Trump, with his questionable relationship with Vladimir Putin, his dodgy business record, and today’s astonishing allegations that Russia has evidence that is personally compromising to him.

But maybe, far from remaking the world in his image, Obama has been a catastrophic failure. Maybe he is just a little bit too much like the Jake Gyllenhaal character in the Tom Ford film Nocturnal Animals: gifted, sensitive and creative, but not perfectly calibrated for power. We loved the way he walked softly: we may come to wish, despite ourselves, that he had actually used that big stick.

Where he should have sustained solidarity, Trump’s victory appears to prove it has been squandered. Where he tried to conciliate, Trump’s victory suggests an atavistic yearning for confrontation. Obama’s concern for the uninsured, his public tears for his inability to curb gun ownership, are being thrown back in his face by a man who wants to destroy his legacy and boasts the enthusiastic backing of the National Rifle Association. Maybe Obama has only proved that in the end strength does not depend on reason.

Certainly where Europe has loved American presidents before, it has often been out of heartfelt relief at the arrival of whatever the contemporary equivalent was of the cavalry. For the past 100 years, the first role for the US in Europe, in European eyes, has been to rescue it by force of arms from undemocratic power.

But democracy is not protected only by military hardware. And that is the first reason why, as individual countries wrestle with democracy’s limits, Obama – and not only Barack, but the whole family, above all Michelle – are exemplars of how despite its flaws, democracy alone can create solidarity: what in his valedictory speech in Chicago last night, Obama described as “the idea that for all our outward differences, we … rise or fall as one”.

Obama gives way to a man who represents the shattering of a cohesion that generations have taken for granted

Obama gives way to a man who represents the shattering of a cohesion that generations have taken for granted, not only across the US but across the democratic world. It’s as if William Hogarth, the 18th-century caricaturist of good and evil, has reappeared in the global Gin Lane of the 21st to illustrate the same thought – only the choice is no longer between beer or something stronger, but the eloquent virtues of moderation against the bawdy and careless excess of a lascivious reality TV star.

In this world, moral courage becomes invaluable. Societies fracture over a generation, not two presidential terms. Years hence, it will be clear that the original choice of Obama eight years ago represented one version of the US that despite all his efforts was not on its own enough to overcome the obstacles to winning over the other, the version that is largely white, that feels excluded from its birthright by incomers with mimsy ideas about gay marriage, and that definitely doesn’t want to pay taxes.

Winston Churchill and Elizabeth I have always been the top-rated Britons in the US, admired for their courage, self-reliance and ambition. Europe has good reason to be suspicious of all these qualities. So we on this side of the Atlantic will go on treasuring Obama for his grace and emotional intelligence; and for the strength of his decency. An underrated quality that would never win a war and doesn’t often win elections – but might sometimes keep the peace and protect democracy.