Barack Obama. Pool/Reuters President Barack Obama on Tuesday warned of a need to "guard" against a rise in nationalism both at home and abroad during a press conference in Greece one week after the election of Donald Trump.

Alongside Greek Prime Minister Alexis Tsipras, Obama said that "separate and apart from any particular election or movement," that guard is a necessity.

"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,'" he said. "And I will never apologize for saying that the future of humanity, the future of the world is going to be defined by what we have in common, [not] those things that separate us and ultimately lead us into conflict."

The self-described alt-right, a movement that believes strongly in ethnocentricity and nationalism, helped usher Trump into the presidency. Trump in turn elevated Steve Bannon, a top executive of the alt-right media outlet Breitbart, to his campaign CEO and, more recently, to his chief strategist in the White House.

In Europe, far-right movements have gained traction in a litany of nations, including France and Germany, while a nationalist movement in the United Kingdom helped lead to its vote to exit the European Union.

Obama highlighted Europe's bloody past, namely during World War I and World War II, as reason to avoid a path toward heightened nationalism.

"We know what happens when Europeans start dividing themselves up and emphasizing their differences and seeing a competition between various countries in a zero-sum way," he said. "The 20th century was a bloodbath. And for all the frustrations and failures of the project to unify Europe, the last five decades have been periods of unprecedented peace, prosperity, and growth in Europe."

Turning his focus onto the US, Obama said, "We know what happens when we divide ourselves along the lines of race, religion, and ethnicity."

"It's dangerous," he continued, saying that discrimination against various minority groups prevents the country from reaching its potential.

Asked if he took responsibility for Trump's election, Obama reiterated that he was "surprised" by the election, but said he doesn't "feel responsible for what the president-elect says or does."

"But I do feel a responsibility as president of the United States to make sure that I facilitate a good transition," he said. He added that he will present to Trump and the US his ideas for how to improve the country, and speak out on policies he disagrees with.

Watch the clip below: