Tuesday's memorial service for Nelson Mandela generated some informal diplomacy and political controversy, alongside the praise for the late South African president.
In a moment caught by television cameras, U.S. President Barack Obama shook hands with Cuban President Raul Castro as he walked to the podium.
The handshake was notable because the United States and Cuba have not had diplomatic relations since 1961, at the height of the Cold War, and the U.S. maintains a trade embargo on Cuba. Relations have begun to thaw in recent years.
U.S. officials say the handshake was not pre-planned. But they say the two leaders did not have a substantive discussion, they only exchanged greetings. White House aides say the United States still has "grave concerns" about Cuba's human rights situation.
Mr. Obama also exchanged greetings with Afghan leader Hamid Karzai, but U.S. officials say Mr. Obama did not see the memorial service as a "venue to do business."
The two leaders have been debating the possibility of a continued U.S. troop presence in Afghanistan after foreign forces withdraw in 2014.
The United States says Mr. Karzai must sign the pact by the end of this year or there will be no choice but to withdraw all American troops after 2014.
Mr. Obama is popular in South Africa, and thousands of people in the stadium cheered when his image appeared on the giant screen overlooking the field.
In contrast, South African President Jacob Zuma was booed each time his image was shown on the screen. Many South Africans have been angered by recent accusations that Mr. Zuma spent close to $25 million in taxpayer money to renovate his private home.
In all, more than 70 heads of state attended the ceremony, including British Prime Minister David Cameron, French President Francois Hollande, Zimbabwe's President Robert Mugabe and India's President Pranab Mukherjee.