Former South African President Nelson Mandela left hospital on Friday after treatment for an acute respiratory infection, officials said.
Mandela, 92, was admitted on Wednesday, prompting fears for the anti-apartheid icon who
led South Africa as its first black president and is revered at home and abroad as a symbol of reconciliation and hope.
"Madiba is well," Deputy President Kgalema Motlanthe said, using Mandela's clan name.
"He is fine. He's OK. He is in good spirits. He was joking with us," said Motlanthe.
South Africa's surgeon general told the same news conference Mandela was stable and was discharged after treatment for an acute respiratory infection.
"There is no need to panic or to try to see more in what we are saying. For a 92-year-old, he surprises us on a daily basis on his power of recovery," Vejayanand Ramlakan said.
Mandela arrived at his home in Johannesburg's leafy Houghton suburb in a military ambulance, escorted by several police vehicles, Reuters witnesses said.
Ramlakan said Mandela would continue to get medical treatment at home, giving no further details of his illness.
A source close to Mandela told Reuters on Thursday he was recovering from a collapsed lung.
TB in jail
Mandela was diagnosed with tuberculosis in the 1980s while he was jailed and later had an operation to repair damage to his eyes.
In 2001 he had treatment for prostate cancer. He was released from prison in 1990 after 27 years imprisonment.
President Jacob Zuma and the ruling African National Congress appealed for calm after the hospitalisation set off speculation in local media about Mandela's health and brought family members and dignitaries rushing to the hospital.
Motlanthe acknowledged that the government and other parties involved could have handled Mandela's hospitalisation better.
Nearly 24 hours passed from when the Nelson Mandela Foundation said the former president was in hospital for routine tests to the presidency issuing a statement on his health.
Mandela has not been seen in public since the soccer World Cup final in July last year, when he made a brief appearance waving from a golf cart.
In Washington, the White House said President Barack Obama's thoughts were with Mandela.
Mandela retired from public life in June 2004 before his 86th birthday, telling his compatriots: "Don't call me, I'll call you."
Since then he has rarely appeared in public and when he did, he appeared increasingly frail.
In addition to the World Cup, Mandela appeared at a couple of ANC rallies before general elections in 2009.