JOHANNESBURG, South Africa - Nelson Mandela was seriously ill but has steadily improved over the last few days after being diagnosed with a lung infection and undergoing gallstone surgery, South African President Jacob Zuma said Thursday.

It was the first official acknowledgment that Mandela's condition had been grave, and came 13 days after the antiapartheid icon was brought to a hospital in the capital, Pretoria. The government initially said that Mandela, 94, was undergoing medical tests, and the information that followed was terse and sometimes contradictory.

"His condition was serious but he is responding well to treatment and he steadily improved over the last few days," Zuma said at the close of a conference of the African National Congress, the governing political party.

"I've been informed that, at his age, doctors need to intervene in a very gradual and sensitive way in order to maximize the chances of a full recovery," Zuma said. "The medical team has our full confidence, and he is receiving the best care possible."

Zuma referred to Mandela's treatment in a statement several days ago, but his comments on Thursday were the most expansive by any South African official to date. Some commentators have criticized the government for failing to be more transparent about the condition of a man revered at home and abroad.

Mandela was a leader of the struggle against racist white rule in South Africa, serving 27 years in prison for his beliefs. He served one five-year term as president before retiring.

Following intrusions and a media throng at a public hospital where Mandela stayed in 2011, the South African military took charge of his care and the government assumed control of the information about his health.

The Nobel laureate has a history of lung problems, after falling ill with tuberculosis in 1988 toward the end of his prison years.