Former President Mwai Kibaki has been discharged from hospital after undergoing successful surgery.
Doctors at the Netcare Sunninghill hospital in Johannesburg said his condition had improved and there was no need to keep him in the health facility.
He will, however, rest for a few days in Johannesburg before returning home.
He was admitted at the hospital on August 21, after being flown to the South African nation for treatment.
Before traveling, Kibaki had briefly been admitted at the Karen Hospital in Nairobi.
A family at the time said he suffered a stroke.
"(Former) President Kibaki is in jovial and high spirits," the family said on Tuesday evening in a statement.
"He will continue to recuperate for a few more days before returning home."
His health condition stabilizes after undergoing a successful carotid artery surgery on his neck.