US President Barack Obama paid tribute to ailing former South African leader Nelson Mandela as an inspiration to himself and to the world.
The transition to freedom and democracy in South Africa continues to shine as a beacon, Mr Obama said.
Speaking in Pretoria as part of his week-long visit to Africa, Mr Obama said: "My thoughts and those of Americans and people all around the world are with Nelson Mandela and his family, and all South Africans.
"The struggle here, against apartheid, for freedom, Madiba's (Mr Mandela's) moral courage, this country's historic transition to a free and democratic nation, has been a personal inspiration to me, it has been an inspiration to the world, and it continues to be, in so many regions that are divided by conflict, sectarian disputes, religious or ethnic wars, to see what happened in South Africa, the power of principle, and people standing up for what's right, I think continues to shine as a beacon."
Mr Obama added: "The outpouring of love we have seen in recent days shows that the triumph of Nelson Mandela and this nation speaks to something very deep in the human spirit.
"The yearning for justice and dignity that transcends boundaries of race and class and faith and country, that's what Nelson Mandela represents, that's what South Africa at its best can represent to the world."
The South African government has said the condition of Mr Mandela, 94, is stable but remains critical. He was admitted to a Pretoria hospital three weeks ago with a recurring lung infection.
Mr Obama plans to make a private visit to relatives of Mr Mandela later but does not intend to see the unwell former leader, who became South Africa's first democratically elected president in 1994 after spending 27 years in prison.