Doctors were treating Mandela and he was responding to treatment, a statement from President Jacob Zuma's office said.
Mandela, 94, was hospitalized over the weekend at a Pretoria facility but the exact nature of his ailment had not been released.
Tuesday's statement said he had a recurrence of a previous lung infection.
Mandela has not appeared in public since the 2010 World Cup hosted by South Africa. The former president gets round-the-clock care after abdominal surgery this year and an acute respiratory infection in 2011.
The Nobel Peace Prize laureate spent 27 years in prison for fighting against oppression of blacks in South Africa. He became the nation's first black president in 1994, four years after he was freed from prison.
Despite his rare appearances, Mandela retains his popularity and is considered a hero of democracy in the nation.
Just last month, South Africa launched a new batch of banknotes with a picture of a smiling Mandela on the front.
The new 10, 20, 50, 100 and 200 rand banknotes all feature pictures of the global icon.