A maximum security prison in Kenya has been the unusual setting for a ceremony awarding a diploma from the University of London.
Peter Ouko, an inmate at Kamiti prison in Nairobi, has received a diploma in common law.
A former death row inmate, Ouko followed the course online and will now advance to a further law qualification.
The event at the prison on Friday was attended by senior judge Richard Mwongo, representing the chief justice.
At the scene: BBC Africa's Frenny Jowi
There was cheering, a prison band, dancing and much joy as more than 100 people - including prison inmates and high-profile guests - celebrated Peter Ouko's graduation in the grounds of Kamiti high security prison.
His elderly mother and grown-up daughter were also there - and helped him cut a giant cake made for him by celebrity chef Daniel Mungai, who insisted that a ceremonial sword be used as it was an "extraordinary occasion".
Lorna Ouko said she had always wanted her son, the ninth-born of her 12 children, to go to law school - and that his graduation was "a dream come true", even if he was behind bars.
Ouko said he had wanted to study law because he felt that he was wrongly convicted of his wife's murder - and he now enjoyed being able to give free legal advice to his fellow prisoners.
There are another eight prisoners and a prison warder who are following the law course from the UK university.
The course is part of the University of London International Programmes, which provide degrees by distance learning.
Jenny Hamilton, director of the university's undergraduate laws programme, said: "Despite the difficult circumstances and lack of resources, these students have demonstrated tremendous determination.
"And while prisoners are aware of their limitations to practise, they are nevertheless confident that they have a useful role to play in supporting civil society."
Ouko, said that rather than "getting mad and losing it" in prison, studying was a way of "keeping it sane and safe for the long haul".
He has been in prison for 16 years - first on death row and then serving life imprisonment after being convicted of murdering his wife.
He has contested the verdict and gaining a law qualification is part of his campaign to prove his innocence.
He said that he was more confident than many conventional students taking the exam, which was invigilated in Kenya by the British Council.
"I was amused to see some candidates who had prepared in better facilities and who had come driving big cars leave in a huff after after a few minutes in the exam room," said Ouko.
The prison education programme was supported by a London-based charity, the African Prisons Project, which supports the welfare of prison inmates in Kenya and Uganda.
The charity's founder, Alexander McLean, said the project showed how "prisons can be places of positive transformation".
The British Council's country director in Kenya, Tony Reilly, said that the council worked closely with the University of London International Programmes, which currently provide access to university courses for 54,000 students in over 180 countries.
This is claimed as the world's oldest provider of distance learning degrees, dating back to the middle of the 19th Century.
Among former jailed students of such University of London external courses was Nelson Mandela, who studied as an external student when imprisoned in South Africa.
During World War Two, thousands of soldiers who were in German prisoner of war camps used these external programmes to study for degrees.