Mandela, 94, who has been in frail health for several years, spent most of December in a Pretoria hospital - his longest stay for medical care since his release from prison in 1990.
He has been receiving treatment at his Johannesburg home after he left hospital on Dec. 26.
"President Mandela has made steady progress and clinically, he continues to improve," the Office of the Presidency said in a statement.
Mandela had recovered from his surgical procedure and the lung infection, it said, citing his medical team. He has made steady progress and was slowly returning to his daily routine.
Nobel Peace Prize laureate Mandela has a history of lung problems dating back to when he contracted tuberculosis as a political prisoner. He spent 27 years in prison, including 18 years on the windswept Robben Island off Cape Town.
He became South Africa's first black president after the first all-race elections in 1994 brought an end to apartheid.
Mandela has been mostly absent from the political scene for the past several years due to poor health, while questions have been raised as to whether his ruling African National Congress (ANC) has lost the moral compass he bequeathed it.
Under such leaders as Mandela, Walter Sisulu and Oliver Tambo, the ANC gained wide international respect as it battled white rule. Once the yoke of apartheid was thrown off, it began ruling South Africa in a blaze of goodwill from world leaders who viewed it as a beacon for a troubled continent and world.
Close to two decades later, this image has dimmed as critics accuse ANC leaders of indulging in the spoils of office, squandering mineral resources and engaging in power struggles.
Mandela's "Rainbow Nation" of reconciliation has come under strain under President Jacob Zuma, a Zulu traditionalist with a history of racially charged comments, including a statement in December where he reportedly said dog ownership was for whites and not part of African culture.
Mandela has spent much of the past year at another home in Qunu, his ancestral village in the poor Eastern Cape province.