Kenya's High Court has sentenced a senior policeman to death for the murder of a detainee – one of two cases resulting in rare officer convictions.

In a separate case, five senior police officers were found responsible for the death of a six-month-old baby hit over the head by riot police.

Kenya's police have previously faced accusations of impunity over killings.

Nahashon Mutua received a death sentence for fatally beating detainee Martin Koome with a metal bar in 2013.

Mutua was the officer in charge at a police station in the capital, Nairobi, when Koome was brought in following a domestic fight.

The officer had tried to frame an inmate for the murder but he was convicted in December and sentenced to death on Thursday.

Surprise result

Nahashon Mutua's death sentence trended on Kenyan social media within minutes of his sentencing. Not many Kenyans would have expected the outcome. Policemen in Kenya have got away with it before: brutal beatings, torture and even broad daylight killings, some caught on camera.

The state stubbornly refuses to acknowledge it as a widespread problem; dismissing the cases as individual bad apples. But all the hard work of human rights groups, public pressure and the six-year-old Independent Police Oversight Authority (Ipoa) is beginning to bear fruit.

More officers are getting charged and prosecutors are beginning to win cases. The civilian-led Ipoa is getting plaudits for holding police officers accountable, and many Kenyans hope this new trend will be a deterrent.

Amnesty International says justice has prevailed against extrajudicial killings, but maintains it does not support the death penalty, which is still part of Kenyan law.

In another courtroom on the same day, five police commanders were found responsible for the death of baby Samantha Pendo.

Samantha was beaten on the head in the middle of clashes between police and demonstrators in Kisumu, in the west of Kenya, after Uhuru Kenyatta was announced as the winner of the presidential election in 2017. She died in hospital three days later.

In September, the BBC's Africa Eye investigative unit highlighted police impunity in Kenya, covering the story of a notorious officer who became national news after mobile footage showed him gunning down two apparently unarmed men in broad daylight.

The film focused on one Nairobi neighbourhood, Eastleigh.