MADRID, Spain (AFP) — Former US President Barack Obama warned in Madrid Friday of "a rise in nationalism" and the potential of new media to accelerate social divisions.

"We're in a difficult time, politically, socially... people feel very anxious," said Obama, who left office last year.

"Change is happening very quickly. People are wondering can I adapt to these changes? People are fearful," the former president told an audience of 2,000 people at a conference in Madrid on technological innovation and the circular economy, which minimises waste.

"We see a rise in nationalism" Obama told his audience.

The world needs to consider how to use the new technology to improve lives and ensure that it "does not accelerate division", he added.

"Today because of the internet and because of the multiplicity of media what we see more and more is that we don't agree on the same reality."

The former Democrat president highlighted in particular the US Fox News network.

"If you watch Fox News you see a different reality than if you read the New York Times, he said. “Climate change is not happening at all" in media like Fox.

This phenomenon "has been "exploited by some forces internationally", which "feed their biases".

The solution, according to Obama, is to train young people"to think differently".

Obama, who was to travel on to Porto in Portugal on Friday to attend a climate change conference, has criticised his successor President Donald Trump for failing to consider scientific research on the subject.