Former USPresident Barack Obama delivers a speech during the 4th Congress of Indonesian Diaspora in Jakarta, July 1, 2017. (Photo by AFP)

Former US President Barack Obama warns against “aggressive” nationalism and President Donald Trump’s decision to leave the Paris climate agreement.

Obama made the remarks on Saturday at the Fourth Congress of the Indonesian Diaspora in Jakarta while he and his family were there on holiday.

“We start seeing a rise in sectarian politics. We start seeing a rise in an aggressive kind of nationalism. We start seeing both in developed and developing countries an increased resentment about minority groups and the bad treatment of people who don’t look like us or practice the same faith as us.”

After taking office in January, Trump issued a travel ban against people from predominantly Muslim countries. The ban and its second version were both blocked by two federal judges. However, on Thursday the US Supreme Court allowed the ban to be enforced pending a full hearing in October.

Trump insists his ban is necessary for national security, but critics have called the ban discriminatory against Muslims.

Obama also touched upon the Paris climate accord and the US withdrawal from it which provoked national and international criticism.

“In Paris, we came together around the most ambitious agreement in history to fight climate change,” he said, adding the deal “will still give our children a fighting chance.”

US President Donald Trump steps off Air Force One upon arrival at Morristown Municipal Airport in Morristown, New Jersey, on July 1, 2017. (Photo by AFP)

He also talked about democracy and freedom of press amid Trump’s continuous barrage of criticism against US media.

“If we don’t stand up for tolerance and moderation and respect for others, if we begin to doubt ourselves and all that we have accomplished, then much of the progress that we have made will not continue,” Obama said.

“What we will see is more and more people arguing against democracy, we will see more and more people who are looking to restrict freedom of the press, and we’ll see more intolerance, more tribal divisions, more ethnic divisions, and religious divisions and more violence,” he added.

Trump has recently criticized major US media outlets including CNN, ABC, The New York Times and The Washington Post.

He has also launched a personal attack against two MSNBC hosts, Mika Brzezinski and Joe Scarborough, which was condemned by both Democrats and Republicans alike.