Kenya's President has commuted the sentences of all the country's death row inmates to life imprisonment.

Thousands of prisoners condemned to death have been spared their lives although Kenya very rarely carries the sentences out - the last execution taking place in 1987.

At the stroke of a pen, President Uhuru Kenyatta commuted the sentences of 2,655 male and 92 female death row inmates.

In 2009, then President Mwai Kibaki commuted the sentence of 4,000 prisoners then residing on death row.

Critics have labelled the latest mass reprieve as an attempt by Mr Kenyatta to appear compassionate in the upcoming election.

Amnesty International praised the move despite previously condemning the Kenyan government's treatment of protesters in May.

The charity's director for East Africa, the Horn and the Great Lakes, Muthoni Wanyeki said: "The decision to commute death sentences brings Kenya closer to the growing community of nations that have abolished this cruel and inhuman form of punishment."

"It must now be abolished for posterity."

In pictures: Kenyan police crackdown on protests Show all 10 1 /10 In pictures: Kenyan police crackdown on protests In pictures: Kenyan police crackdown on protests Kenya protests Protesters run away from the police during clashes in Nairobi, Kenya May 16, 2016. Reuters In pictures: Kenyan police crackdown on protests Kenya protests Kenyan riot police officers use water canon to disperse supporters of the Kenya's opposition Coalition for Reforms and Democracy (CORD), during a protest on May 16, 2016 AFP/Getty Images In pictures: Kenyan police crackdown on protests Kenya protests A man is knocked off his motorbike by Kenyan riot police officers during a demonstration of Kenya's opposition supporters in Nairobi, on May 16, 2016. AFP/Getty Images In pictures: Kenyan police crackdown on protests Kenya protests Opposition supporters, some carrying rocks, flee from clouds of tear gas fired by riot police, during a protest in downtown Nairobi, Kenya Monday, May 16, 2016. AP In pictures: Kenyan police crackdown on protests Kenya protests An elderly woman caught up in the clashes holds her hands in the air as a riot policeman approach amidst clouds of tear gas, during a protest in downtown Nairobi, Kenya Monday, May 16, 2016. AP In pictures: Kenyan police crackdown on protests Kenya protests A Kenyan riot policeman repeatedly kicks a protester as he lies in the street after tripping over while trying to flee from them, during a protest in downtown Nairobi, Kenya, Monday, May 16, 2016. AP In pictures: Kenyan police crackdown on protests Kenya protests A Kenyan riot policeman repeatedly kicks a protester as he lies in the street after tripping over while trying to flee AP In pictures: Kenyan police crackdown on protests Kenya protests Kenyan riot police officers raise batons over a man during a demonstration of Kenya's opposition supporters in Nairobi, on May 16, 2016. AFP/Getty Images In pictures: Kenyan police crackdown on protests Kenya protests A man runs past a riot police officer trying to kick him during electoral reform protests in Nairobi, Kenya, 16 May 2016. EPA In pictures: Kenyan police crackdown on protests Kenya protests An injured man crawls out of a building after he was beaten by police during a protest in Nairobi, Kenya, 16 May 2016. EPA

Nearly two thirds of all countries have abolished the death penalty, with the remaining third facing pressure to discontinue capital punishment.

China executed the most people last year estimated at more than 1,000 followed by Iran with 977 executions.