It was the second major speech from Obama in South Africa in two days after a previous stop-off in Kenya. In that lecture, the former president further touched upon the "head-spinning and disturbing headlines" in the world today, and made several other jokes at the expense of powerful men.
"We see the utter loss of shame in political leaders when they're caught in a lie and they just double down and lie some more", Obama said.
Talking about trade, Obama first expressed his belief in the right for smaller economic powers to access wealthier markets.
"I would have thought we would have figured that out by now", he said.
He warned that countries that engage in xenophobia "eventually. find themselves consumed by civil war".
"It is time for us to stop paying all of our attention to the world's capitals. and focus on the world's grassroots. We've been through lower valleys", but he closed by offering a glimmer of hope when he shared "I say if people can learn to hate, they can be taught to love".
Rarely has one person in history done so much to stir people's dreams and move them to action.
He received a standing ovation and thunderous applause from thousands of guests.
Ramaphosa also said there was no place for racism, tribalism and chauvinism in the South Africa of Nelson Mandela.
The Democratic former U.S. president did not name his Republican successor, Donald Trump, but the speech was among the most pointed comments he has made about politics since leaving office in January 2017.
In another barely veiled attack on Mr. Trump's tactics, Mr. Obama mocked politicians who routinely lie and who never back down when their lies are exposed.
Nelson Mandela, who died at the age of 95 in 2013, is a legendary icon for headlining the anti-apartheid battle in South Africa.
Obama attended a charity event in Edinburgh Tuesday evening for her first official global appearance since leaving the White House. The US under Trump has withdrawn from the 2015 Paris climate agreement and the Iran nuclear deal, and tried to undercut the Affordable Care Act, known as Obamacare.
Many found this speech to be a passionate condemnation of identity politics.
But during Obama's lecture, he seemed to make a thinly veiled criticism at the current USA administration's use of "alternative facts".
Ramaphosa was there to lead centenary celebrations of Mandela who was the country's first black President.
Mr Obama met Mandela only briefly in 2005 but gave a eulogy at his funeral saying Mandela "makes me want to be a better man" and hailing him as "the last great liberator of the 20th century".
"And I believe that a world governed by such principles is possible and that it can achieve more peace and more cooperation in pursuits of a common good".
Stremlau, who attended the speech, called it "a tough, strong condemnation of Trump and all that he stands for".
Adidas Committed to Using Only Recycled Plastics by 2024
In the retail industry, Adidas is one of just a few major companies that has made a commitment to becoming more sustainable. The material is cheap and versatile, but governments and consumers are increasingly aware of its huge environmental costs.