Nelson Mandela has left hospital and has gone to his Johannesburg home, where he is continuing to receive intensive care, the South African presidency says on its website.
The announcement came a day after officials denied reports that the 95-year-old had already been discharged.
The statement says Mr Mandela condition remains critical and at times unstable.
South Africa's first democratically elected president has been in hospital since June with a lung infection.
The Nobel Peace Prize laureate is revered around the world for leading the fight against white minority rule and preaching reconciliation with the white community despite being imprisoned for 27 years.
"His team of doctors are convinced that he will receive the same level of intensive care at his Houghton home that he received in Pretoria [hospital]," the presidency statement says.
It says his home in the suburb of Houghton has been "reconfigured to allow him to receive intensive care there" and he will be treated by the same health care personnel who have been looking after him since 8 June.
If necessary, he will be readmitted to hospital, the statement says.
Johannesburg is about 55km (34 miles) south of South Africa's capital, Pretoria.
On Saturday, sources close to Mr Mandela told the BBC and other international media that he had already returned home.
This was denied by South Africa's presidency, which handles all communications about the former leader's health.
Mr Mandela's lung condition is said to result from the tuberculosis he contracted during the 27 years he spent in prison for taking up arms against white minority rule.
He is been hospitalised four times in the past year.
He became president after 1994 elections - the first time black South Africans were allowed to vote - and stepped down five years later. His last public appearance was at the 2010 football World Cup, which South Africa hosted.
Mandela's key dates
- 1918 - Born in the Eastern Cape
- 1944 - Joined African National Congress
- 1956 - Charged with high treason, but charges dropped
- 1962 - Arrested, convicted of sabotage, sentenced to five years in prison
- 1964 - Charged again, sentenced to life
- 1990 - Freed from prison
- 1993 - Wins Nobel Peace Prize
- 1994 - Elected president
- 1999 - Steps down as leader
- 2001 - Diagnosed with prostate cancer
- 2010 - Appears at football World Cup