BERLIN (Reuters) - Former U.S. President Barack Obama told an audience in Berlin on Thursday that prosperous nations could not “hide behind a wall” to shield themselves from the turmoil and poverty afflicting other countries.

German Chancellor Angela Merkel and former U.S. President Barack Obama attend a discussion at the German Protestant Kirchentag in front of the Brandenburg Gate in Berlin, Germany, May 25, 2017. REUTERS/Fabrizio Bensch

Speaking in a panel discussion on democracy with German Chancellor Angela Merkel in front of 70,000 people at a spot where the Berlin wall once stood, Obama spent 90 minutes talking about international and U.S. issues without once mentioning his successor Donald Trump.

But in what appeared to be a reference to Trump’s vow to build a wall along the border with Mexico to keep out illegal immigrants and drugs, Obama said the world was shrinking due to localisation and technology. It was not possible to stay isolated from troubles abroad, he said.

“If there are disruptions in these countries, if there is bad governance, if there is war or if there is poverty, in this new world that we live in we can’t isolate ourselves,” Obama said. “We can’t hide behind a wall.”

Obama, who was making his first speech in Europe since leaving the White House, also warned against taking peace and prosperity for granted.

“The world is at a crossroads,” said Obama, speaking in front of the Brandenburg Gate.

The widening inequality gap inside nations as well as between nations was a major concern, he said. At the same time, “The world has never been wealthier, more healthy and never been better educated.”

Slideshow ( 8 images )

“If we can sustain that progress, then I’m very optimistic about our future. My job now is to help them take it to the next step.”

In another speech later in the southwestern German town of Baden-Baden where he accepted a German media prize, Obama said he was concerned about how technology advances had made “it ironically easier for people to retreat into our own bubbles.”

He added: “We can find people on the internet who agree with our ideas, no matter how crazy. Democracies do not work if we are not operating on some level based on reason and fact and logic - and not just passion. We’re going to have to find ways to push back on propaganda and listen to those we don’t agree with.”

Obama said he had spent the last four months “trying to catch up with my sleep” and spending more time with his family.

“I’m very proud of the work I did as president,” he said to cheers, adding he was especially proud of health care reform.

“My hope was to get 100 percent of people health care. We didn’t quite achieve that but we were able to get 20 million people health care who didn’t have it before. Certainly I have some regrets that we weren’t able to get everyone health care.

“Now some of the progress we made is imperiled because a significant debate is taking place in the United States,” he added, again avoiding direct mention of Trump, who is attempting to dismantle the so-called Obamacare.

Just four months before Germany’s election, Obama’s mere appearance with Merkel, broadcast live on four networks, raised concerns that he was helping her re-election campaign.

But Merkel and Obama stayed away from the campaign with their discussion focused on faith and politics in general.

He said he hopes to use the “little influence” he has as a former president to help young people be better prepared for the looming challenges.