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 his 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 statement from the presidency says that Mr Mandela will still receive the same level of intensive care from the same people who treated him at the Pretoria hospital – so in effect a special medical unit has been created in his home.
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.