President Obama met with the family of ailing former South African President Nelson Mandela on Saturday, unable to visit the hospitalized civil rights icon he considers a personal hero.

“I expressed my hope that [Mandela] draws peace and comfort from the time that he is spending with loved ones, and also expressed my heartfelt support for the entire family as they work through this difficult time,” Obama said after spending 30 minutes with Mandela’s family in Johannesburg. “I also reaffirmed the profound impact that his legacy has had in building a free South Africa, and in inspiring people around the world – including me. That’s a legacy that we must all honor in our own lives, including this July on Mandela Day.”

At the request of Mandela’s relatives, Obama opted not to visit with the leader of the anti-apartheid movement, who has been battling a lung infection for three weeks. Mandela, 94, remains in critical but stable condition.

The president met with Mandela’s daughters and multiple grandchildren before hosting a town hall aimed at college students in South Africa.

Obama on Sunday will also travel to Cape Town’s Robben Island, where Mandela spent nearly two decade in prison.

Mandela has cast a large shadow over Obama’s weeklong trek through Africa, with stops in Senegal, South Africa and Tanzania. The first black presidents of their respective countries have met just once, at a hastily arranged get-together in Washington when Obama was just a junior senator from Illinois.

During a press conference earlier Saturday with South African President Jacob Zuma, Obama praised Mandela for not clinging to power despite his unparalleled popularity.

“We as leaders occupy these spaces temporarily and we don’t get so deluded that we think the fate of our country doesn’t depend on how long we stay in office,” Obama said, comparing Mandela to America’s first president, George Washington.