The former South African president, Nelson Mandela, has been discharged from hospital, the South African presidency says.
Mr Mandela will continue to receive treatment at his home in Johannesburg until he has fully recovered, according to a statement from President Jacob Zuma's office.
Mr Mandela, 94, was admitted to hospital 18 days ago.
He was treated for a lung infection and gallstones.
His wife, Graca Machel, and President Zuma visited him on Christmas Day and said he was in good spirits.
Afterwards, Mr Zuma said doctors were happy with the progress Mr Mandela had made.
In his statement on Sunday, Mr Zuma thanked South Africans for the messages of good wishes they had sent.
"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 latest stay in hospital has been Mr Mandela's longest since leaving prison in 1990.
His grandson, Mandla, said Mr Mandela's absence on Christmas Day had "greatly saddened" the family, adding: "We didn't anticipate that he would be away for so long."
Mr Mandela served as South Africa's first black president from 1994 to 1999 and is regarded by many as the father of the nation.
His health has been a cause of concern for many years.
He first contracted tuberculosis in the 1980s while detained in Robben Island prison.
He has been admitted to hospital on three occasions in the past two years.
Mr Mandela lives in Qunu, a small rural village in Eastern Cape province, where he says he spent the happiest days of his childhood.
He retired from public life in 2004 and has been rarely seen in public since.
--Courtesy of BBC News