Instead, Obama found himself warning of an impending shift in the global order, one he advised could lead to a “meaner, harsher, more troubled world” if not stopped.

“Whoever is president and whoever is the chancellor of Germany and whoever is the leader of other European nations and other democracies around the world, they need to recognize that,” Obama said. “There are going to be forces that argue for cynicism. For looking the other way with somebody else’s problems. That are not going to champion people who are vulnerable because sometimes that’s politically convenient.”

“If we don’t have a strong transatlantic alliance that’s standing up for those things, we will be giving to our children a worst world,” he said. “We will go backwards instead of forwards. So whoever the US president is, whoever the chancellor of Germany is, we need to remember that. And our citizenry who decide who our presidents and chancellors are need to remember that.”

It was a dire prediction that barely matched the upbeat attitude Obama has attempted to put forward as he works to facilitate a peaceful transition to Trump’s presidency. In his appearances in Europe, Obama has made a point of hailing the NATO alliance, insisting that Trump remains committed to upholding the group’s commitment to mutual defense. And he expressed cautious optimism Thursday that Trump would moderate his tone once he assumes office.

But as his final foreign swing wears on, Obama’s alerts about the wave of nationalist politics spreading in the US and Europe have grown more dire. He bemoaned the way information flows in a digital age, and decried an echo-chamber of falsities masquerading as facts.

Obama: Merkel on the ‘right side of history’00:46

“In an age of social media where so many people are getting their information in sound bites and snippets off their phones, if we can’t discriminate between serious arguments and propaganda, then we have problems,” he said. “If people, whether they’re conservative, liberal, left or right, are unwilling to compromise and engage in the democratic process and are taking absolutist views and demonizing opponents, then democracy will break down.”

He issued a warning to Trump in his dealings with Russia, cautioning that on issues like Ukraine and Syria, Moscow must be confronted head-on.

“I don’t expect the President-elect will follow exactly our blueprint or our approach, but my hope is he does not simply take a realpolitik approach and suggest we cut some deals with Russia, even if it hurts people or violates international norms or leaves smaller countries vulnerable,” he said.

And he said he advised Trump to tone down his campaign rhetoric during their Oval Office meeting last week.

“He ran an extraordinarily unconventional campaign and it resulted in the biggest political upset in perhaps modern political history,” Obama said. “What I said to him was that what may work in generating enthusiasm or passion during elections may be different than what will work in terms of unifying the country and gaining the trust even of those who didn’t support him.”

This is Obama’s final visit as President to Berlin, the city where he introduced himself to the world in 2008 but where he now faces persistent questions about the future of transatlantic ties and liberal progress.

Obama spent most of his time huddling with Merkel, his closest counterpart who is now Europe’s most powerful leader as the continent prepares for Trump’s presidency.

She expressed guarded optimism about Trump Thursday, her controlled demeanor barely reflecting an iota of worry about the man who lambasted her as a candidate. She praised Obama for facilitating a smooth transition, and said she was approaching Trump with an “open mind.”

As her European counterparts face political challenges at home, Merkel has assumed a critical role in transatlantic ties, voicing strong support for Obama’s priorities on climate change, Russian sanctions and economic reform.

The personal chemistry between the leaders was on display Thursday, Obama winking as he sat for talks in Merkel’s chancellery, and Merkel grinning as she anticipated a visit from Obama in his post-presidency.

“I’m game!” she said.

The German leader has not yet said whether she’ll run for a fourth term next year, though her political allies have signaled she will. Like leaders in France, Britain, the US and elsewhere, she’ll face challenges from far-right politicians who are running on an agenda of populist nationalism.

Obama declined to push her to run Thursday, but suggested he would vote for her if he was German.

Obama finds himself in Germany in a vastly different political environment than when he first spoke here as a candidate in 2008. Back then, a crowd of 200,000 gathered in the city’s Tiergarten to hear a young senator extoll the necessity of multilateral ties after George W. Bush-era tensions.

Europeans had grown wary of the US during Bush’s presidency. They regarded Obama as an urbane, liberal counterpoint to a Republican administration that had grown derisive of Europe in the debate over the Iraq War.

During his 2008 speech, Obama lauded open and diverse societies.

“The walls between races and tribes, natives and immigrants, Christian and Muslim and Jew cannot stand,” Obama said then. “These now are the walls we must tear down.”

Now, as Trump drafts plans to erect a wall on the US border with Mexico, those words seem from a distant past. While he remains insistent on the values of liberal, open societies, Obama has grown more realistic about the speed and scope of change.

“I think our politics everywhere are going to be going through a bumpy phase,” Obama said.