Mandela’s strengthening health after several difficult days raised the possibility of a meeting between the two men, who shattered racial boundaries on either side of the Atlantic.
Before he touched down in Pretoria, Obama indicated he would defer to Mandela’s family about whether to visit the ailing anti-apartheid icon.
“I do not need a photo op. The last thing I want to do is to be in any way obtrusive,” Obama said aboard Air Force One.
“I think that the message we’ll want to deliver is not directly to him but to his family, is simply profound gratitude for his leadership all these years,” he added.
Mandela, who turns 95 next month, has been in intensive care for three weeks for a recurrent lung disease dating from his years in apartheid-era prisons.
After taking a turn for the worse last weekend, he has since shown tentative signs of recovery.
“From what he was a few days ago, there is great improvement, but clinically he is still unwell,” said ex-wife Winnie Madikizela-Mandela, who has visited him regularly in hospital.
She called on the media not to “get carried away” in their reporting on her former husband’s illness, but thanked them for their support.
“Please understand the sensitivities and the feeling of the family,” added the MP, who tirelessly campaigned for Mandela’s release during his 27-year imprisonment under apartheid.
“We had no idea of the love out there for us in our particular situation and if sometimes we sound bitter it is because we are dealing with a very difficult situation,” she added.
Supporters have been gathering outside to offer prayers for the man who negotiated an end to decades of racist white minority rule and went on to become South Africa’s first black president.
“I came to pray for our father Nelson Mandela. We are wishing for our father to be fine,” said Thabo Mahlangu, aged 12, part of a group from a home for abandoned kids who travelled to Pretoria.
A wall of handwritten notes of prayers for Mandela’s recovery has become the focal point for South Africans paying tribute to the father of their nation, with singing and dancing by day and candlelight vigils at night.
One message read: “If you can fight prison, you can beat this”. Another said: “You are such an incredible inspiration to millions”.
Mandela’s plight has lent a deeply poignant tone to Obama’s three-day stay, part of a three-nation Africa tour.
A visit by Obama to Mandela’s former jail cell on Robben Island, off Cape Town on Sunday in particular is expected to be laden with symbolism.
Speaking in Senegal on the first leg of his long-awaited African trip, Obama described Mandela as “a personal hero”.
“I think he is a hero for the world, and if and when he passes from this place, one thing I think we all know is that his legacy is one that will linger on throughout the ages.”
The US president recalled how Mandela had inspired him to take up political activity, when he campaigned for the anti-apartheid movement as a student in the late 1970s.
The men met in 2005, when the former South African president was in Washington, and Obama was a newly elected senator, and the two have spoken several times since by telephone.
But there has been no face-to-face meeting between them since Obama was elected in 2008.
During his trip, Obama was also due to host a town hall meeting at the University of Johannesburg’s campus in Soweto, the township where Mandela once lived, as part of the US president’s Young African Leaders Initiative.
He will visit a community centre with fellow Nobel Peace laureate Archbishop Desmond Tutu and give a speech at the University of Cape Town.
But he will not be greeted warmly by all South Africans. “NObama” demonstrations were held in Pretoria by a coalition of leftist, pro-Palestinian and anti-drone groups.
The group was protesting against what it described as the “arrogant, selfish and oppressive foreign policies” of the United States.
Mandela has been hospitalised four times since December, mostly for a stubborn lung infection.
The man once branded a terrorist by the United States and Britain walked free from prison near Cape Town in 1990.
He won South Africa’s first fully democratic elections in 1994, forging a path of racial reconciliation during his single term as president, before taking up a new role as a roving elder statesman and leading AIDS campaigner.
As he now languishes in hospital, his relatives are pitted against each other in a legal battle, reportedly over where members of the family should be buried.
On Friday, sixteen members of the Mandela family brought an urgent application to a regional court, reportedly to force Mandela’s grandson Mandla to return remains of family members to a plot in the ancestral village where Mandela has said he wants to be buried.
Mandla, a local chief in nearby Mvezo, had exhumed the remains of three of Mandela’s children in Qunu in 2011 and brought them to his village, allegedly without the consent of the rest of the family.