South Africa's anti-apartheid hero Nelson Mandela was discharged from hospital on Wednesday after almost three weeks being treated for a lung infection but will continue to receive medical care at home, the presidency said.
The much-loved 94-year-old had been admitted to a hospital in the capital Pretoria on December 8, the latest health scare for South Africa's first black president.
"Former president Nelson Mandela was discharged from hospital this evening," said a statement from President Jacob Zuma's office.
"He will undergo home-based high care at his Houghton (Johannesburg) home until he fully recovers."
He had been flown to Pretoria from his rural home in Qunu in the south of the country for treatment for a recurring lung infection. Doctors then discovered that he had developed gallstones and he had surgery to have them removed.
It was his longest hospital stay since coming out of prison in 1990 after 27 years in detention.
Mandela, once a spry boxer who stayed fit during his long years behind bars by doing calisthenics in his cell, has grown increasingly frail as a nonagenarian. He has rarely been seen since retiring from public life in 2004.
"We request a continuation of the privacy consideration in order to allow for the best possible conditions for full recovery," the presidency statement said.
The Nobel Peace laureate was visited on Christmas Day by his wife Graca Machal and other family members along with Zuma, who said Mandela was "looking much better".
"The doctors are happy with the progress that he is making," Zuma said in a statement Tuesday. "We found him in good spirits."
Mandela's grandson Mandla had told a local television station that the family was saddened by his absence on Christmas Day.
"We didn't anticipate that he would be away for so long," Mandla said.
Messages of support and prayers for the recovery of the man affectionately known as Madiba, his clan name, have been pouring in from all over the country.
While many South Africans have resigned themselves to the idea of life without their most respected citizen, he remains highly esteemed as the father of the nation who fought with the African National Congress against apartheid rule.
He won the Nobel Peace Prize in 1994 along with former president F.W. de Klerk.
Only limited details of Mandela's condition have been made public by the South African government, which has repeatedly called on the public to respect his privacy.
Mandela, who became South Africa's first black president after the country's first all-race elections in 1994, has a long history of lung problems, dating back to the time when he was a political prisoner on Robben Island.
He contracted tuberculosis - a disease which killed his father - while in jail.
In January 2011 he was hospitalised for two nights for an acute respiratory infection.
Mandela was last seen in public in 2010, clad in a scarf during the closing ceremony of the FIFA World Cup, when he was wheeled into the Johannesburg stadium in a golf cart.
Mandela stepped down in 1999 after serving one five-year term as president before taking up a new role as a leading campaigner against AIDS.
His critics said his five-year presidency was marred by corruption and rising levels of crime but his successors Thabo Mbeki and Jacob Zuma have never enjoyed the same levels of both respect and affection.