ATHENS — President Obama, in some of his strongest language since Donald J. Trump’s election last week, on Tuesday warned against the rise of nationalistic tribalism, apparently a reference to Mr. Trump’s decision to appoint Stephen K. Bannon, a hard-right nationalist, to a top position.

“I do believe, separate and apart from any particular election or movement, that we are going to have to guard against a rise in a crude sort of nationalism or ethnic identity or tribalism that is built around an ‘us’ and a ‘them,’” Mr. Obama said.

Mr. Obama’s remarks came in an hourlong news conference in Athens on his final trip overseas as president. He had come to Greece partly to bolster Greek hopes of further debt relief from its European partners, which will meet on Dec. 5 to consider giving this ailing nation another pass on its mountain of debt.

But Mr. Trump’s election last week subverted Mr. Obama’s top foreign policy priorities, and he seemed to have arrived in Athens in a reflective mood.

On Monday, just hours before he flew across the Atlantic, Mr. Obama offered conciliatory remarks on Mr. Trump and his coming administration during a White House news conference. He declined on Monday to comment on Mr. Trump’s selection of Mr. Bannon — a media executive whose website,, has promoted white nationalist, racist and anti-Semitic views — as chief White House strategist and senior counselor.

By Tuesday, however, Mr. Obama seemed to reverse himself, making pointed remarks about the dangers of overturning his administration’s track record on race relations or returning to decades-old forms of bigotry.

“In the United States, we know what happens when we start dividing ourselves along lines of race or religion or ethnicity. It’s dangerous,” he said. “Not just for the minority groups that are subjected to that kind of discrimination or, in some cases in the past violence, but because we don’t then realize our potential as a country when we’re preventing blacks or Latinos or Asians or gays or women from fully participating in the project of building American life.”

Mr. Obama was unapologetic and unequivocal on his record of inclusiveness.

“So my vision’s right on that issue,” he said. “And it may not always win the day in the short term in any particular political circumstance, but I’m confident it will win the day over the long term.”

Mr. Obama said that the desire for change was a huge factor in Mr. Trump’s victory.

“Sometimes people just feel as if we want to try something to see if we can shake things up, and that I suspect was a significant phenomenon,” he said.

He said that while Mr. Trump’s victory and Britain’s surprising vote in June to leave the European Union differed in important respects, the two electoral earthquakes both grew out of dislocations that have resulted from of a rapidly changing and globalizing world.

“Globalization combined with technology combined with social media and constant information have disrupted people’s lives, sometimes in very concrete ways,” Mr. Obama said while standing next to Prime Minister Alexis Tsipras of Greece. “A manufacturing plant closes, and suddenly an entire town no longer has what was the primary source of employment.”

He said the effects can be psychological as well, making people “less certain of their national identifies or their place in the world.”

“When you see a Donald Trump and a Bernie Sanders, very unconventional candidates, having considerable success, then obviously there is something there that is being tapped into,” Mr. Obama said. “A suspicion of globalization. A desire to rein in its excesses.”

The increasing pain felt by working people had led to a growing suspicion of elites and governing institutions, he said.

“And that sometimes gets wrapped up in issues of ethnic identity or religious identity or cultural identity and that can be a volatile mix,” Mr. Obama said.

Mr. Obama complimented Mr. Tsipras on the political and structural reforms he had pushed through — reforms that severely damaged Mr. Tsipras’s popularity in Greece. And he said he planned to urge others in Europe to forgive more of Greece’s debt.

Mr. Obama will fly on Wednesday to Berlin, where he will spend at least two days in meetings with Chancellor Angela Merkel of Germany, and then in a meeting with the leaders of France, Britain and Spain.

Mr. Trump has questioned the value of NATO, the bedrock Western military alliance between Europe and the United States. But Mr. Obama said that Mr. Trump had assured him during their Oval Office meeting last week that he remained committed to NATO.

Also on Tuesday, Mr. Obama said he believed that “there is a window in the next few weeks” to resolve the 42-year-old standoff between Greece and Turkey on the island of Cyprus. Turkish troops have occupied the northern third of the island since an invasion in 1974.

For his part, Mr. Tsipras again denounced Europe’s decision in the aftermath of the 2008 financial crisis to embark on a program of “disastrous austerity, which made the problems more acute instead of resolving them.” He noted that Greece’s economy at its worst had contracted by 25 percent and that its unemployment rate had peaked at 27 percent.

See more at: