President Barack Obama returned to the White House on Wednesday after travelling halfway around the world to attend the memorial service for Nelson Mandela.

Obama's speech at a rain-soaked soccer stadium in Johannesburg was perhaps the most electrifying moment of a day of remembrances about the life of Nelson Mandela, who died last Thursday at age 95.

Throughout his speech, Obama sprinkled references to his determination to work to reduce income inequality in the United States.

His appeal to people who embrace Mandela's life mission to actually live by it may have been directed toward his Republican opponents, who have sought to stymie his agenda on many fronts.

Obama's brief trip to South Africa offered a respite from partisan battles in Washington over spending and, more recently, the botched rollout of his signature healthcare plan.

The troubles have weighed heavily on his presidency and contributed to a decline in his popularity among Americans, who now give him a 38 percent job approval rating, among the lowest of his five years in office.

During the service Obama hailed Nelson Mandela as a "giant of justice'' but said too many leaders in the world claimed solidarity with his struggle for freedom "but do not tolerate dissent from their own people''.

Obama, speaking at a memorial in Johannesburg for Mandela, made the comment in front of an audience of leaders that included Chinese Vice President Li Yuanchao, Cuban President Raul Castro and Zimbabwe's president, Robert Mugabe.