Nairobi, Kenya: With a stroke of his pen, President Uhuru Kenyatta on Monday spared the lives of thousands of prisoners on Kenya’s death row by commuting their sentences to life in prison.

Kenyan law allows capital punishment, and convicts are regularly sentenced to death, but the sentence is almost never carried out; the last execution was in 1987. In colonial times, the British authorities executed more than 1,000 Kenyans who were accused of fomenting revolt.

Kenyan news sites beamed images of Kenyatta leaning over his desk on Monday, surrounded by top officials, as he signed documents that spared the lives of 2,655 men and 92 women. Kenya’s last president, Mwai Kibaki, did something similar in 2009.

Kenyatta faces re-election next year. Some analysts said the mass reprieve may have been intended to make the president appear more compassionate as the election draws near. Kenyatta remains popular among members of his own ethnic group, the Kikuyu, and he enjoys support from other ethnic groups that belong to his political alliance. But opposition leaders say his government has allowed corruption to flourish.

Amnesty International, which has accused Kenyatta’s government of brutal crackdowns on protesters and of other human rights abuses, praised the reprieve, which covers everyone on death row in Kenya.

“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,” said Muthoni Wanyeki, the group’s regional director for East Africa, the Horn and the Great Lakes. “It must now be abolished for posterity.”