Barack Obama, on his first official tour of South Africa, met privately with the family of critically ill Nelson Mandela today.

The meeting took place in Johannesburg at the Nelson Mandela Center of Memory, which is part of the former South African president's foundation.

The White House didn't say which Mandela family members Obama met with, but it did confirm that the president's wife Michelle was not present for the visit.

The president and First Lady will not be meeting with the ailing 94-year-old Mandela, who has been in hospital since June 8 with a lung infection. The White House said that decision was made in accordance with the Mandela family's wishes.

"Out of deference to Nelson Mandela's peace and comfort and the family's wishes, they will not be visiting the hospital," the White House said in a statement.

Obama told reporters on the flight to South Africa on Friday that he was grateful that he, his wife and daughters had a chance to meet Mandela previously. Obama hangs his photo of the introduction he had to Mandela in 2005 in his personal office at the White House — their only meeting, when Obama was a senator.

"I don't need a photo op," Obama said. "The last thing I want to do is to be in any way obtrusive at a time when the family is concerned about Nelson Mandela's condition."

"Outside of the medical issues, there were grave moral and political considerations here. A visit could have been seen as politically opportunistic and South Africans are extremely sensitive right now about Mandela's dignity. President Jacob Zuma met with Mandela a few months back, and pictures were published with Mandela looking unresponsive and frail; it backfired politically for Zuma," said CBC's Susan Ormiston, reporting from South Africa.

'The last thing I want to do is to be in any way obtrusive at a time when the family is concerned about Nelson Mandela's condition.'—Barack Obama

"It is hard to imagine another country where the President of the United States would be overshadowed by a domestic event but that is very much the case here. South African's are glad Obama is here but their concern is in the hospital in Pretoria so, there's ambivalence about the visit."

Obama met with South African President Jacob Zuma Saturday morning, greeting each other's wives with kisses with a military honor guard standing by holding flags from both countries. Their meeting was at the grand Union Buildings, where Mandela was inaugurated as the country's first black president in 1994 after 27 years behind bars under racist rule.

The two leaders later held a joint news conference in Pretoria.

Obama reiterated that he wants to boost trade with Africa and plans to renegotiate an African trade pact to improve it for American businesses. He said he welcomes competition from other nations who have been aggressive in pursuing commercial opportunities in Africa, including China.

"I don't feel threatened by it. I think it's a good thing," he said. He added: "Our only advice is make sure it's a good deal for Africa." He said that includes making sure foreign investment employs Africans and doesn't tolerate corruption or take its natural resources without compensation for Africans.

Obama also told reporters that Mandela continues to shine as a beacon of the power of principle and standing up for what's right.

The U.S. president also said South Africa's transition from apartheid to a free nation has been a personal inspiration and an inspiration to the world.

He said the recent outpouring of love for the critically ill anti-apartheid icon shows the deep yearning for justice and dignity in the human spirit. That yearning transcends class, race and country, he added.

si-safrica-obama

Thomas Coutts and Calvern Hugo stand outside Johannesburg University Soweto Campus, where Obama is meeting with students. (Susan Ormiston/CBC)

Obama has said the imprisoned activist's willingness to risk his life for the cause of equal rights helped inspire his own political activism. Obama said his message during the visit will draw on the lessons of Mandela's life, with a message that "Africa's rise will continue" if its people are unified instead of divided by tribe, race or religion.

"I think the main message we'll want to deliver if not directly to him but to his family is simply a profound gratitude for his leadership all these years and that the thoughts and prayers of the American people are with him and his family and his country," Obama said on his flight into the country.

Obama also is paying tribute to the fight against apartheid by visiting the Soweto area Saturday afternoon for a town hall with students at the University of Johannesburg. At least 176 young people were killed in Soweto township 27 years ago this month during a youth protest against the apartheid regime's ban against teaching local Bantu languages. The Soweto Uprising catalyzed international support against apartheid, and June is now recognized as Youth Month in South Africa.

Obama said it was a "powerful tribute" to those who died that day that he and everyone in the town hall could gather in a free South Africa and at a university where everyone was welcome.

"I know the story inspires you in your lives but keep in mind, it inspired me, too"

About 150 protesters from a range of trade unions and civil society groups demonstrated outside the university ahead of Obama's arrival, but police fired warning shots and cleared the streets by the time of the town hall. Some had dressed in orange coveralls to protest the Guantanamo Bay prison and other held signs depicting Obama with an Adolf Hitler moustache.

"People died in Libya. People are still dying in Syria," said 54-year-old Ramasimong Tsokolibane. "In Egypt, in Afghanistan in Pakistan drones are still killing people. So that's why we are calling him a Hitler. He's a killer."

The university plans to bestow an honorary law degree on the U.S. president, while protesters are planning demonstrations against U.S. policy on issues including the U.S. detention centre at Guantanamo Bay, Cuba, the war in Afghanistan and global warming. Hundreds marched to the U.S. Embassy on Friday, carrying signs that read: "No, You Can't Obama," a message inspired by Obama's "yes, we can" campaign slogan.

Obama, the son of an African man, has been trying to inspire the continent's youth to become civically active and part of a new democratically minded generation. Obama hosted young leaders from more than 40 African countries at the White House in 2010 and challenged them to bring change to their countries by standing up for freedom, openness and peaceful disagreement.

Obama wraps up his South Africa stay Sunday, when he plans to give a sweeping speech on U.S.-Africa policy at the University of Cape Town and take his family to Robben Island to tour the prison where Mandela spent 18 of his 27 years behind bars.