BERLIN — The man whom Chancellor Angela Merkel calls “dear Barack” was back in Berlin on Saturday, his lanky figure and easy smile a reminder for Germans of a different era that ended not so long ago.

But former President Barack Obama had not come to speak about the past. He came to speak to the future: some 300 young leaders from across Europe, who had gathered for a town hall-style meeting in the German capital.

It did not take long for Mr. Obama to touch on one of his main concerns — and the reason he had come to what he called “the heart of Europe.”

Europe, Mr. Obama suggested, is one of the main battlefields between liberal democracy and far-right populism.