Kolding (Denmark) (AFP) - Former US president Barack Obama warned Friday against rising nationalism as he painted a grim picture of American and global politics on a visit to Denmark.

"I'm concerned enough about the international and American trends that I thought it was important to offer my views," he told entrepreneurs and students in the Danish central city of Kolding.

"When you start seeing our politics driven completely free of facts, when you start seeing a debate that is driven solely on racial or nationalistic impulses, when you start seeing a rejection of science and expertise and logic in politics... we are beyond the sort of politics that will continue our best traditions," he added.

Relatively discreet since leaving the White House on January 20, 2017, the 44th President of the United States carefully avoided any direct reference to his successor Donald Trump.

"Maybe we got more jolt and more change than we expected in the US," Obama said, drawing laughter from the crowd.

He expressed concern over a lack of citizen engagement in public life and underlined the importance in the United States, Europe, and in other countries "to affirm the ideals of our constitution."

Referring to the right-wing populist Law and Justice Party (PiS)'s arrival in power in Poland and the fiercely anti-immigration government in Hungary, Obama said: "there is a shift that has implications for all of Europe."

"When a population is passive and ill-informed and not paying attention, that's when there is the greatest danger."