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.

Getty Images

President Barack Obama shook hands with Cuban President Raul Castro at a memorial service for former South African President Nelson Mandela.

The handshake between the leaders of the two Cold War enemies came during a ceremony that's focused on Mandela's legacy of reconciliation. Obama was greeting a line of world leaders and heads of state attending the memorial in Johannesburg. He also shook hands with Brazilian President Dilma Rousseff, who has clashed with Obama over alleged National Security Agency spying.

The U.S. and Cuba have recently taken small steps toward rapprochement, raising hopes the two nations could be on the verge of a breakthrough in relations. But skeptics caution that the two countries have shown signs of a thaw in the past, only to fall back into old recriminations.  (Associated Press)