Nairobi - Kenyan judge Martha Koome has defended dissidents and helped to write women's rights into the constitution - now parliament has confirmed her to be the first female chief justice in a country where the role is particularly sensitive.
A child of subsistence farmers, she was chosen by a judicial panel in preference to the lawyer who argued President Uhuru Kenyatta's case in a 2017 battle with the Supreme Court that she will now head.
Kenyatta will swear her into office in coming days after parliament voted to approve her nomination on Wednesday. That makes her likely to be in place during next year's elections, when Kenyatta must step down after two terms in office.
In 2017, the Supreme Court annulled initial election results that showed Kenyatta had won a second term, the first African court to have scrapped the victory of a sitting president. Kenyatta won the rerun after the opposition boycotted the vote.
Koome - who has 33 years of legal experience - cut her teeth representing political detainees such as former prime minister Raila Odinga when he protested against repression under the late president Daniel Arap Moi in the 1980s and 90s.
"She played a key role in the fight for the second liberation from the authoritarian regime of President Moi," Priscilla Nyokabi, a lawyer and former legislator, said.
One of 18 children in a polygamous family, Koome co-founded and chaired the Federation of Women Lawyers, which campaigns for women's rights and offers poor women free legal services and contributed to a landmark 2010 constitution.
The bill of rights outlawed discrimination against women, allowed children to derive citizenship from their mothers for the first time and limited discriminatory customary laws on women's property rights.
Now 61, Koome, who is married with three children, will be the first female head of any Kenyan branch of government. She often discusses her Christian faith and airs views at odds with the deep conservatism of much of the church and society.
In 2019, at the Court of Appeal, she supported a ruling that said it was not illegal to identify as gay. Gay sex is punishable by 14 years in jail, although the law is rarely used.
"You cannot discriminate against a person because you are assuming they will commit an offence," she said at her interview for the chief justice position, which was broadcast live on television.
Enforcing human rights may be the easy part.
The judiciary faces a vast backlog, with many judgements taking at least five years, another candidate for the chief justice position, Nduma Nderi from Nairobi's employment and labour relations court, said during his interview.
Underfunding has led some courts to halt hearings and a row between the recently retired chief justice and president delayed the appointment of 41 judges.
Corruption is also a problem: 11 out of 53 judges were fired by a vetting panel between 2011-2016.
At her interview, Koome said she had cleared a year-long backlog of cases as a judge in the Rift Valley town of Kitale by commuting jail sentences, speeding manslaughter trials with plea-bargaining and prioritising property succession cases. A lawyer in Kitale confirmed her account.
During her time at the Court of Appeal, Koome and her fellow judges in the central town of Nyeri were commended by authorities for clearing a five-year backlog of cases.
"Kenyans want cases to be heard expeditiously," she said.