Former South African President Nelson Mandela is showing "great resilience" although remains in a critical but stable condition, the country's government said.

The 95-year-old anti-apartheid hero led the fight to end the white minority-rule racist regime which jailed him for 27 years.

He has been in hospital since early June with a lung infection.

"While at times, his condition becomes unstable, the doctors indicate that the former president has demonstrated great resilience and his condition tends to stabilise as a result of medical interventions," the South African presidency said in its latest update. 

"Doctors are still working hard to effect a turnaround and a further improvement in his health and to keep the former president comfortable," the statement added.

It was the first update in almost two weeks on the health of the Nobel Peace Prize laureate.

News of his hospitalisation in June with a recurring lung infection attracted worldwide attention for the revered statesman, who is admired as a symbol of struggle against injustice and of racial reconciliation.

Mandela celebrated his 95th birthday in hospital on 18 July, showered with tributes from around the world.

He spent nearly three decades in prison before being released and being elected South Africa's first black president in multi-racial elections in 1994 that ended apartheid rule.

Mandela's 27 years in prison under white minority rule included 18 years on the notorious Robben Island penal colony.

His lung infection dates back to his time, when he and other prisoners were forced to work in a limestone quarry.

South Africa's current president Jacob Zuma flies to Malaysia on an official visit where he will receive a global peace award on behalf of former president Mandela.