JOHANNESBURG (AP) — President Barack Obama says Nelson Mandela earned his place in history through struggle, shrewdness, persistence and faith.

Obama is eulogizing the former South African president at a memorial service in Johannesburg. He's comparing Mandela to Mahatma Gandhi, Martin Luther King Jr. and Abraham Lincoln.

Obama is urging the world to act on Mandela's legacy by fighting inequality, poverty and racism. He says progress in the U.S. and South Africa mustn't cloud the fact there's still work to be done. He says South Africa shows us that we can change.

Obama calls Mandela the last great liberator of the 20th century, and says he thinks about how to apply Mandela's lessons to himself as a man and as president.

World leaders and joyous, singing South Africans have gathered to honor Nelson Mandela at a Soweto soccer stadium.

A cold, driving rain has kept many people away, and the 95,000 seat stadium has been about two-thirds full so far.

The ceremony began about an hour late, and while the mood was celebratory, the crowds twice booed scandal-plagued South African President Jacob Zuma, who is to give the keynote address.

A dazzling mix of royalty, statesmen and celebrities is in attendance, with the list running from Afghan President Hamid Karzai (HAH'-mihd KAHR'-zeye) to Zimbabwe's Robert Mugabe (moo-GAH'-bay).

Former South African president Thabo Mbeki (TAH'-boh um-BEH'-kee), who succeeded Mandela, got a rousing cheer as he entered the stands, while United Nations Secretary-General Ban Ki-moon waved and bowed to spectators.

One black student in the crowd said Mandela's 27 years in prison had brought him freedom. Another man, who said he grew up in a "privileged position" as a white South African, credited Mandela with helping release whites from a burden of guilt through the country's reconciliation process.

More From Hot 107.9