Former President Barack Obama took the stage in South Africa to celebrate the 100th anniversary of Nelson Mandela's birth Tuesday, appearing to offer a counter-argument to the policies and rhetoric of his successor, Donald Trump.

"Given the strange and uncertain times that we are in. And they are strange, and they are uncertain," Obama said at the 2018 Nelson Mandela Annual Lecture in Johannesburg. "With each day's news cycle bring more head-spinning and disturbing headlines, I thought maybe it would be useful to step back for a moment and get some perspective."

While not directly mentioning Trump by name, Obama's high-profile speech offered a counter-argument to many of his successor's policies, centered on a respect for human rights, the promotion of racial diversity and support for a free and independent press.

These days "we see much of the world threatening to return to a more dangerous, more brutal, way of doing business," Obama said, adding that politicians pushing the "politics of fear, resentment, retrenchment" are on the move "at a pace unimaginable just a few years ago."

"It's not wrong to insist national borders matter," Obama said. "But that can't be an excuse for invasive policies based on race or ethnicity … and we can enforce the law while respecting the essential humanity of somebody striving for a better life."

Obama's comments came a day after Trump's comments questioning U.S. intelligence following his summit with Russian President Vladimir Putin earned widespread criticism, and as the Trump administration has been under fire for enacting a "zero-tolerance" stance on migrants crossing the Mexican-U.S. border illegally, which resulted in the separation of nearly 3,000 children from their parents.

Obama's most direct criticism toward Trump was over his administration's decision to withdrawal from the Paris agreement on climate change, which is supported by nearly 200 counties across the globe.

"I can't find common ground if someone says climate change isn't happening," Obama said, pointing out that scientists overwhelmingly agree that humans are contributing to the planet's changing climate. "If you start saying it's an elaborate hoax, where do we start?"

Obama also touched on the issue of objective truth, decrying politicians who make up facts to pander to supporters and feel no shame when called out for lying.

"Politicians have always lied, but it used to be if you caught them lying, they'd be like, 'Aw, man,' " Obama said. "But now if you catch them lying, they'll just keep on lying!"

As of Tuesday morning, Trump made 3,251 false or misleading claims while in office, according to the Washington Post's The Fact Checker's database, which analyzes, categorizes and tracks statements made by the president.

This is Obama's first visit to Africa since he left office in early 2017. His speech highlighted how Mandela, who was imprisoned for 27 years, became South Africa's first black president after fighting to end the country's racist system of apartheid.