JOHANNESBURG -- South Africa's former President Nelson Mandela underwent a successful surgery to remove gallstones Saturday, the nation's presidency said, as the 94-year-old anti-apartheid icon is still recovering from a lung infection.

Doctors treating Mandela waited to perform the endoscopic surgery as they wanted to first attend to his lung ailment, presidential spokesman Mac Maharaj said in a statement. Mandela has been hospitalized since Dec. 8.

In the procedure, a patient usually receives sedatives and an anesthetic to allow a surgeon to put an endoscope down their throat, authorities say. The surgeon then can remove the gallstones, which are small, crystal-like masses that can cause a person tremendous pain.

"The procedure was successful and Madiba is recovering," Maharaj said, using Mandela's clan name as many do in South Africa as a sign of affection.

Occasionally, a patient who undergoes the same medical procedure Mandela just had may need to have an additional surgery to have the gallbladder removed, according to medical experts. However, Maharaj's statement offered no other details about what additional care Mandela may require, nor did it suggest when he could be released from the hospital.

Mandela, South Africa's first democratically elected president, was admitted last week to a hospital in South Africa's capital, Pretoria, the government has said. At first, officials said Mandela was undergoing tests and later they acknowledged he had been diagnosed with a lung infection.

The Nobel laureate has a history of lung problems, after falling ill with tuberculosis in 1988 toward the tail-end of his 27 years in prison before his release and subsequent presidency. While doctors said at the time the disease caused no permanent damage to his lungs, medical experts say tuberculosis can cause problems years later for those infected.

South Africa, a nation of 50 million people, reveres Mandela for his magnamity and being able to bridge racial gaps after centuries of white racist rule.

This hospital stay, his longest since leaving prison in February 1990, has sparked increasing concern about a man who represents the aspirations of a country still struggling with race and poverty.

Following the chaos that surrounded Mandela's stay at a public hospital in 2011, the South African military took charge of his care and the government took over control of the information about his health. However, public worries over Mandela have grown as government officials contradicted themselves in recent days about Mandela's location, raising questions about who is actually treating him.

On Saturday, the South African National Editors' Forum issued a statement criticizing the government for not being straightforward with journalists about Mandela's hospitalization. The forum said that journalists had been working with the government to set up guidelines on how to handle covering Mandela in his waning years, though state officials ultimately declined to sign off on the agreement.

"Senior government representatives have sought to justify misleading statements about the circumstances surrounding Mr. Mandela's whereabouts on the basis of irresponsible conduct by print and broadcast news organizations," the statement read. "Nothing could be further from the truth."

The editor's forum includes members from newspapers, television broadcasters and radio stations in South Africa, as well as the Foreign Correspondents Association of Southern Africa.

Mandela largely retired from public life after serving one five-year term. He last made a public appearance when his country hosted the 2010 World Cup soccer tournament. Mandela has also grown more frail in recent years, with his grip on politics in the nation ever slackening.