World leaders from across the globe braved the South African rain on Tuesday morning as they paid their respects to the nation’s first black president and iconic antiapartheid crusader Nelson Mandela in a state memorial service in Johannesburg.

U.S. President Barack Obama, United Nations Secretary General Ban Ki-moon, British Prime Minister David Cameron, retired Anglican Archbishop Desmond Tutu and French President François Hollande appeared at the memorial service in a show of solidarity for the late South African president.

“South Africa, the world thanks you for sharing Mandela with us,” Obama said. “His struggle was your struggle. His triumph was your triumph. Madiba would emerge as the last great liberator of the 21st century.”

In a surprisingly controversial moment at the service, Obama briefly greeted and shook hands with Cuban President Raul Castro. The unplanned gesture between the heads of two rival nations garnered some outrage online, though it lasted only a few moments.