Barack Obama spent the months before the US election denouncing Donald Trump as unfit for office. Now he must eat his words. When he makes his final visit to Europe this week, in what had been planned as a triumphant farewell tour, Obama’s awkward job is to reassure nervous allies that a Trump presidency will not be as bad as they fear.

It’s a tall order. François Hollande, France’s president, said in August that Trump’s excesses “make you want to retch”.

Obama put a brave face on the election result when he invited his successor to the White House last week. He has promised an orderly transition. But he must worry that much of what he worked for could be about to go up in smoke. When he meets the leaders of Germany, Britain, France and Italy in Berlin, it could be hard to disguise his true feelings.

Speaking in May about how US allies viewed Trump, Obama said: “They’re rattled by him, and for good reason, because a lot of the proposals he’s made display either ignorance of world affairs, or a cavalier attitude, or an interest in getting tweets and headlines instead of actually thinking through what it is that is required to keep America safe and secure and prosperous, and what’s required to keep the world on an even keel”.

Any attempt by Obama to soften this piercing analysis is likely to be unconvincing. Instead, he may privately coach his host, Angela Merkel, Germany’s long-serving chancellor, on the best ways to keep Trump in line. The White House sees Merkel as its most reliable, ideologically compatible and able European ally. Obama’s spokesman said she had been America’s “closest partner” throughout his presidency.

When flummoxed European leaders greeted Trump’s success with dismay and rudeness last week, Merkel took the high ground. She made clear future cooperation would depend on Trump’s acceptance of “democracy, freedom, respect for the law and for human dignity irrespective of origin, skin colour, religion, gender, sexual orientation or political views”.

Obama could not have put it better. With Theresa May untested and under pressure from the same populist, nationalist forces that swept Trump to power, Britain and its inexperienced foreign secretary, Boris Johnson, cannot be counted on to uphold Obama’s world view. France is facing its own anti-establishment uprising as elections approach. Italy’s centre-left leader, Matteo Renzi, could be toast if he loses a referendum on constitutional reform in December. Other European leaders lack stature.

With Trump in the Oval Office and Republicans in charge in Washington, that leaves Merkel, the level-headed, pro-market centrist, as the closest thing to a successor Obama has on the international stage.

As the Americans see it, Merkel – and certainly not the vainglorious European commission president, Jean-Claude Juncker – runs the EU. It is Merkel who negotiated the Minsk deal with Russia that defused the Ukraine crisis. She knows Vladimir Putin better than any other western leader does. It is Merkel who took the lead on Syrian refugees and the eurozone crisis.

Trump or no Trump, Obama bequeaths a lot of regional problems, ranging from Isis to Israel-Palestine. A big European concern is continued Nato cohesion in the face of Russia’s military buildup in the Baltic region, its political meddling in eastern Europe and its bloody intervention in Syria.

Obama will offer assurances that the ostensibly pro-Putin Trump, who has been critical of Nato, will not be able to dismantle or fundamentally change the alliance – although, in truth, he cannot be certain of that. Berlin’s renewed interest in developing independent EU defence capabilities is one area where Merkel’s and Obama’s views diverge.

Obama will urge the EU to swallow its objections to the authoritarian behaviour of Turkey’s president, Recep Tayyip Erdoğan, whose cooperation he deems vital in fighting Isis and fashioning an Iraq-Syria settlement. Now that Erdoğan and Putin are back on speaking terms, Erdoğan is threatening to cancel Turkey’s EU membership bid.

Likewise, Obama will press the Europeans to defend his landmark nuclear deal with Iran and the Paris climate change agreement against expected assaults by Trump.

But he will probably have to concede that the proposed transatlantic trade and investment partnership (TTIP), disliked in much of Europe, will not survive his departure.

In a symbolic speech in Athens this week, Obama will offer a final exposition of his core beliefs about the enduring, paramount importance of democracy and civil liberties and of an interconnected, tolerant world of open borders, open markets and open minds.

He will acknowledge that many angry voters in the US and Europe feel they have been left behind, while arguing that Trumpism and similar phenomena are not the answer. But it may be a sad rather than uplifting farewell to Europe. His power is ebbing away. Obama the historian-president is almost history himself now. And Trump is intent on erasing him and all his work.