Obama warns of changing global politics: We're 'going through this bumpy phase'

President Barack Obama predicted that global politics in Western democracies like the United States and parts of Europe were in for a rough patch due to changing economies and social media.

"I think our politics everywhere is going to be going through this bumpy phase," Obama said during a press conference with German Chancellor Angela Merkel on Thursday.

"But as long as we stay true to our democratic principles. As long as elections have integrity, as long as we respect freedom of speech, freedom of religion, as long as there are checks and balances in our government. ... Then I have confidence that over the long term, progress will continue."

RELATED: President Obama with German Chancellor Angela Merkel for farewell visit

The president also speculated about the roots of economic and racial anxieties in Western nations which have manifested themselves in major political shakeups like President-elect Donald Trump's upset victory and the United Kingdom's decision to leave the European Union.

"People are feeling less certain about their identity, less certain about security. They're looking for some means of control," Obama said.

"What that means is that the politics in all of our countries is going to require us to manage technology and global integration and all these demographic shifts in a way that makes people feel more control, gives them more confidence in their future, but does not resort to simplistic answers or divisions of race or tribe, or a crude nationalism."

SEE ALSO: Tim Kaine: No plans to run for president or VP in 2020

Thursday's comments were the latest in a series of cautious warnings Obama has made during his final global trip as president about the swelling rightward shift in many Western democracies.

During a press conference on Tuesday in Greece, Obama called for vigilance in the face of nationalism and xenophobia, which he hinted could have dramatic consequences.

RELATED: The cutest pictures of the Obamas through the years

"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,'" Obama said on Tuesday. "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."

Trump's nativist rhetoric, restrictivist trade message, and closeness with "alt-right" figures such as newly appointed strategist Steve Bannon, who formerly headed Breitbart News, has signaled for many in the US a political lurch that could change the country's relationship with close allies and immigrants at home.

RELATED: President Obama meets with Trump

NOW WATCH: Trump goes on a tweetstorm less than 48 hours after promising to be more 'restrained' on Twitter

More from Business Insider:

SEE ALSO: One of the biggest Democratic donors explains why he doesn't regret dropping $75 million on the 2016 election