PRETORIA, June 29 (Xinhua) -- Visiting U.S. President Barack Obama on Saturday lauded anti-apartheid icon Nelson Mandela for his outstanding contributions to South Africa. It was "great" to see what was happening in South Africa, when so many other regions were divided by conflict and disputes, Obama said in Pretoria after talks with his South African counterpart Jacob Zuma. Obama wished a quick recovery for Mandela who spent his 22nd day in hospital for a recurring lung infection. Mandela's condition remains critical but stable after showing some improvement in the past two days, according to Zuma who issued the latest update on Mandela's health after talks with Obama. The government hopes that Mandela, 94, will be out of hospital soon, Zuma said in a televised press conference with Obama. "We hope very soon he will be out of hospital," Zuma said. Obama said: "Our thoughts...are with Nelson Mandela and his family, and all of South Africa." He said Mandela has been a personal inspiration to him and continues to shine as a beacon of hope. The outpouring of love for Mandela had showed what he meant to South Africans and the world, said Obama. Earlier, Obama held talks with Zuma on a wide range of issues, including trade, investment opportunities, the US commitment to Africa and democracy in Africa. "Our talks have taken place against the background of the ill health of our beloved former President Nelson Mandela, the founding president of our democracy who is much loved by our people and the world," Zuma said. Zuma said Obama and Mandela are also bound by history, as the first black presidents of their respective countries. Obama arrived Friday evening on a three-day official visit, his second visit to South Africa and the first as the U.S. president. He came from Senegal and will continue to Tanzania after South Africa. Obama will meet Mandela's family but not Mandela himself. Obama said he didn't want to be "obtrusive" when Mandela is bed-ridden in hospital.