President Jacob Zuma found 94-year-old Mandela to still be in critical condition during the 10 p.m. visit and was briefed by doctors "who are still doing everything they can to ensure his well-being," Zuma's office said in a statement.
It said the president decided to cancel a visit to Maputo, the Mozambican capital, on Thursday, where he was to attend a meeting on regional investment.
As worries over Mandela mounted, Mac Maharaj, the presidential spokesman, declined to comment on media reports that the former president and anti-apartheid leader was on life support systems in the Pretoria hospital where he was taken June 8 to be treated for what the government said was a recurring lung infection.
"I cannot comment on the clinical details of these reports because that would breach the confidentiality of the doctor/patient relationship," Maharaj said in an interview with South Africa's Radio 702.
South Africans were torn on Wednesday between the desire not to lose Mandela, who defined the aspirations of so many of his compatriots, and resignation that the beloved former prisoner and president is approaching the end of his life.
The sense of anticipation and foreboding about Mandela's fate has grown since late Sunday, when the South African government declared that the condition of the statesman had deteriorated.
A tide of emotional tributes has built on social media and in hand-written messages and flowers laid outside the hospital and Mandela's home. On Wednesday, about 20 children from a day care center posted a hand-made card outside the hospital and recited a poem.
"Hold on, old man," was one of the lines in the Zulu poem, according to the South African Press Association.
In recent days, international leaders, celebrities, athletes and others have praised Mandela, not just as the man who steered South Africa through its tense transition from white racist rule to democracy two decades ago, but as a universal symbol of sacrifice and reconciliation.
In South Africa's Eastern Cape province, where Mandela grew up, a traditional leader said the time was near for Mandela, who is also known by his clan name, Madiba.
"I am of the view that if Madiba is no longer enjoying life, and is on life support systems, and is not appreciating what is happening around him, I think the good Lord should take the decision to put him out of his suffering," said the tribal chief, Phathekile Holomisa.
"I did speak to two of his family members, and of course, they are in a lot of pain, and wish that a miracle might happen, that he recovers again, and he becomes his old self again," he said. "But at the same time they are aware there is a limit what miracles you can have."
For many South Africans, Mandela's decline is a far more personal matter, echoing the protracted and emotionally draining process of losing one of their own elderly relatives.
One nugget of wisdom about the arc of life and death came from Matthew Rusznyah, a 9-year-old boy who stopped outside Mandela's home in the Johannesburg neighborhood of Houghton to show his appreciation.
"We came because we care about Mandela being sick, and we wish we could put a stop to it, like snap our fingers," he said. "But we can't. It's how life works."
His mother, Lee Rusznyah, said Mandela, who spent 27 years in prison under apartheid before becoming South Africa's first black president in all-race elections in 1994, had made the world a better place.
"All of us will end," Thabo Makgoba, the Anglican archbishop of Cape Town, said in an interview with The Associated Press on Wednesday. "We just want him to be peacefully released, whatever he's feeling at this moment, and to be reunited with his Maker at the perfect time, when God so wills."
The archbishop said: "Ultimately, we are all mortal. At some stage or another, we all have to die, and we have to move on, we have to be recalled by our Maker and Redeemer. We have to create that space for Madiba, to come to terms within himself, with that journey."
On Tuesday, Makgoba visited Mandela and offered a prayer in which he wished for a "peaceful, perfect, end" for the anti-apartheid leader, who was taken to the Pretoria hospital to be treated for what the government said was a recurring lung infection.
In the prayer, he asked for courage to be granted to Mandela's wife, Graca Machel, and others who love him "at this hard time of watching and waiting," and he appealed for divine help for the medical team treating Mandela.
Visitors to the hospital on Wednesday included Mandela's former wife, Winnie Madikizela-Mandela. The couple divorced in 1996.
Mandela, whose 95th birthday is on July 18, served a single five-year term as president and afterward focused on charitable causes, but he withdrew from public life years ago and became increasingly frail in recent years. He last made a public appearance in 2010 at the World Cup soccer tournament, which was hosted by South Africa. At that time, he did not speak to the crowd and was bundled against the cold in a stadium full of fans.
On April 29, state television broadcast footage of a visit by Zuma and other leaders of the ruling party, the African National Congress, to Mandela's home. Zuma said at the time that Mandela was in good shape, but the footage - the first public images of Mandela in nearly a year - showed him silent and unresponsive, even when Zuma tried to hold his hand.
"Let's accept instead of crying," said Lucas Aedwaba, a security officer in Pretoria who described Mandela as a hero. "Let's celebrate that the old man lived and left his legacy."