US President Barack Obama on Saturday hailed the "moral courage" of Nelson Mandela, who he said was an inspiration to the world.

"Madiba's ... moral courage has been a personal inspiration to me. It has been an inspiration to the world," Obama said in Pretoria, using Mandela's clan name.

"The triumph of Nelson Mandela and this nation speaks to something very deep in the human spirit," Obama said.

The US leader earlier decided not to visit the critically ill anti-apartheid icon in hospital in Pretoria, but he will meet members of Mandela's family.

A US official said Obama wanted to preserve the "peace and comfort" of Mandela, who has been in hospital for more than three weeks fighting a life threatening lung infection.

...,/.,