Doctors said the 92-year-old responded well to treatment and would now receive home-based care.
Mandela was admitted to a Johannesburg hospital on Wednesday for a routine checkup. But that hospital stay stretched into a second day, and there are worries the health of the anti-apartheid icon may be failing.
South African Deputy President Kgalema Motlanthe told reporters Friday there's no need to panic and that Mandela is "in good hands."
Mandela was jailed for 27 years for his fight against apartheid. He became South Africa's first black president in 1994 and stepped down after serving one term in 1999. He largely retired from public life in 2004.
The Associated Press contributed to this story.