Former President Nelson Mandela was discharged from a hospital on Saturday following treatment for pneumonia, the presidency said in news that cheered South Africans who had waited tensely for health updates on a beloved national figure.

Mandela, the anti-apartheid leader who spent 27 years in prison for opposing white racist rule, was robust during his decades as a public figure, endowed with charisma and an extraordinary talent for articulating the aspirations of his people and winning over many of those who opposed him. In recent years, however, 94-year-old Mandela became more frail and last made a public appearance at the 2010 World Cup soccer tournament, where he didn’t deliver an address and was bundled against the cold in a stadium full of fans.

South Africans hold the former leader dear as a symbol of sacrifice and reconciliation stemming from his pivotal role in steering South Africa from the apartheid era and into democratic elections in 1994, at a time of great hope but also tension and uncertainty. The new South Africa, beset by economic inequality, crime and corruption, has not lived up to the soaring expectations of its people, but they still see hope through their icon, Mandela.

Primrose Mashoma, a South African, said she wished that Mandela would live, basically, forever.

“I wish him to stay maybe a hundred more years,” she said.

A statement from the office of President Jacob Zuma said there had been “a sustained and gradual improvement” in the condition of Mandela, who was admitted to a hospital on the night of March 27.

“The former President will now receive home-based high care,” the statement said.

Mandela had received similar treatment at his home in Johannesburg after a stay at a hospital in nearby Pretoria in December, when he was treated for a lung infection and had a procedure to remove gallstones. Earlier in March, the anti-apartheid leader was hospitalized overnight for what authorities said was a successful scheduled medical test.

During Mandela’s latest hospitalization, doctors drained fluid from his lung area, making it easier for him to breathe.

On Saturday afternoon, shortly after the presidential statement on Mandela’s discharge, a military ambulance was seen entering his home in the Johannesburg neighborhood of Houghton. In recent years, Mandela had been spending more time in Qunu, the rural area in Eastern Cape province where he grew up. But his delicate condition required that he be moved to South Africa’s biggest city.

Many South Africans refer affectionately to Mandela by his clan name, Madiba. Buildings, squares, and other places have been named after him, and his image adorns statues and artwork around the country. The central bank issued new banknotes last year that show his smiling face.

“I’m really happy about Madiba coming out,” said student Anele Gcolotela, using Mandela’s clan name, a term of affection. “I think it’s been too long now.”

After Mandela’s release from prison in 1990, he was widely credited with averting even greater bloodshed by helping the country in the transition to democratic rule, negotiating with the guardians of the same system that had deprived him of freedom for decades. He became South Africa’s first black president in 1994 after elections were held, bringing an end to apartheid.

The Nobel Peace Prize laureate has been particularly vulnerable to respiratory problems since contracting tuberculosis during his 27-year imprisonment under apartheid.