The meeting took place at the Nelson Mandela Center of Memory, part of the former South African president's foundation.
It lasted for about a half hour, enough time for a small crowd to gather outside for Mr. Obama's departure. The White House says Obama met with two of Mandela's daughters and several grandchildren.
The president will not meet with Mandela himself. The 94-year-old is in critical condition and has been hospitalized for three weeks with a recurring lung infection. The White House says the decision was made in accordance with the wishes of Mandela's family.
The White House initially said first lady Michelle Obama would attend, but later said she did not accompany the president. Mrs. Obama met Mandela during her trip to Africa in 2011.
At a news conference with South African President Jacob Zuma, Mr. Obama said Mandela continues to be an inspiration.
"Nelson Mandela showed what is possible, and the people of South Africa have shown what's possible when a priority is placed on constitutions and rule of law and respect for human dignity," Mr. Obama said.
The president is in South Africa as part of his weeklong trip to promote U.S. investment opportunities and democracy.
The Associated Press contributed to this report.