An inmate at the Kamiti Maximum Security Prison surprised many after he scored 413 marks in this year's Kenya Certificate of Primary Education (KCPE) examinations.
Mr James Macharia Mwangi, 29, is serving a jail term for causing death by dangerous driving. He hopes to further his studies once released in 2019.
"I'm very overjoyed. I'm so happy," said the smiling inmate who used to be a matatu driver before he was jailed.
He explained that before being sentenced he had studied up to Class Eight but dropped out of school.
"I will continue [with] my education and I hope to study law once I've completed Form Four," he said.
Mr Mwangi, who was carried shoulder high by his fellow inmates who were also his classmates, attributed his success to hard work, discipline and prayers.
Their class which had 15 candidates recorded a mean score of 317 marks with six students scoring 350 marks and above.
Ms Jane Kirii, the officer in charge of the prison said that since the facility does not have provisions for secondary school education, the inmates who want to continue with their studies may have to be transferred to Nairobi West Prison.
She said the success recorded in the exams can be attributed to hard work from both the teachers and the students.
"I have seven teachers who help, some of whom are inmates and they worked very hard to produce this," she said.
Mr Dan Muchiri, a teacher who is also an inmate, said Mr Mwangi had been a model student all along and they had expected him to score more than 400 marks.
However, he appealed to the government to expand their academy as they have limited learning space and as such sometimes have to divide the rooms among the various classes for learning to go on.
"We are extremely happy about this performance and we would like to see more inmates performing as well which is why we are praying that the government adds more classrooms," he said.