In one of his most high-profile appearances since leaving the White House, former President Obama warned tens of thousands of young people in Berlin that "the international order is at a crossroads."

President Trump was also in Europe, chiding NATO members while in Belgium for not living up to agreed-upon defense-spending levels.

Obama delivered an implicit rebuke to Trump's "America First" policy, saying in the modern, interconnected world, "we can't isolate ourselves. We can't hide behind a wall."

Despite being largely out of sight since leaving office (aside from appearing in occasional paparazzi photos on billionaires' yachts), Obama seemed eager to rejoin the debate over globalism that's been shaping elections in the U.S. and Europe.

He stressed that an increasingly integrated economic order had delivered unparalleled peace and prosperity to the continent. But he cautioned that success could not be taken for granted.

"It has to be continually renewed, because there is a competing narrative of fear and xenophobia and nationalism and intolerance," Obama told the large crowd near Brandenburg Gate. "We have to push back against those trends."

That tension, between globalism and nationalism, has flared in recent elections in the West, be it Brexit (Great Britain's choice to leave the European Union), France, Germany and, of course, Trump versus Hillary Clinton.

Obama, who offered an upbeat assessment of European progress, was joined on stage by German Chancellor Angela Merkel at an event marking the 500th anniversary of the Protestant Reformation. Later, Merkel would join Trump at the NATO summit in Brussels.

In his speech, Trump goaded NATO allies to increase their defense spending. While Obama often made the same point, quietly, when he was president, he cautioned his audience in Berlin that military might should not be viewed in isolation.

"The national-security budget shouldn't just be seen as military hardware," Obama said, stressing the importance of diplomacy and development to national security, as well.

Trump's budget proposal would move the U.S. in the opposite direction. It calls for deep cuts to the State Department and foreign aid budgets, while boosting spending on military troops.

Obama did not back away from military power entirely, telling a young questioner, "We do live in a dangerous world."

As if to underscore that point, he and Merkel offered condolences to the victims of Monday's terrorist bombing in Manchester, England.

"It's a reminder that there is great danger and terrorism," Obama said, "and people who would do great harm to others just because they're different."

The former president also defended his signature domestic policy, the Affordable Care Act, which the Republican Congress is working to repeal.

"Obviously, some of the progress that we made is imperiled, because there is still a significant debate taking place in the United States," Obama said. He conceded the law, commonly known as Obamacare, had not extended health insurance to all Americans. But it did boost coverage to some 20 million people.

"For those 20 million people, their lives have been better," Obama said. "And we've set a standard for what's possible that people can build on."

This week, the Congressional Budget Office predicted that a GOP replacement bill passed by the House would leave 23 million fewer people with health insurance by 2026.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.