Changes to Kenya’s constitution in 2010 on the independence of the judiciary created room for judges to act as guardians of the electoral process.

Before this, the law gave Kenya’s presidents considerable influence over courts’ actions. Historically, the judiciary was not an independent branch. It was categorised as a governmental department working under the authority of the attorney general. The president was responsible for appointing judges.

For instance, Daniel Moi, who was president from 1978 to 2002, systematically appointed loyalists. The close links between the government and the judiciary made it pointless to go to court to challenge electoral disputes.

The 2010 constitution changed this. And in 2017, the Kenyan supreme court, the highest court in the country, annulled the re-election of the presidential incumbent, Uhuru Kenyatta. The ruling asked the electoral commission to organise a rerun of the presidential election. This was despite the threats and pressure the judges faced.

As a political scientist and former lawyer researching judicial politics in non-democratic settings, I found this change in behaviour puzzling. In a recent paper, I sought to understand why a court would take such a risk. Where judges face retaliation and pressure from political actors, why – and when – would courts take the risk of nullifying the elections of ruling party candidates?

The Supreme Court knows that any future misstep could threaten the institution’s survival and the country’s political stability.

I found that courts take such risks when there has been institutional reform. But to have this effect, the reform must meet two conditions.

First, a legal framework must shield the judiciary from political interference. It must create distance between the executive and the judiciary branch. Second, legal reforms must also mobilise judicial activists, lawyers and scholars to train and monitor courts on electoral issues. The Kenyan case illustrates how this works.

The legal framework

Kenya’s 2010 constitution put in place mechanisms to shield the judiciary from executive branch interference. First, the judiciary stopped operating under the leadership of the attorney general, an executive office. This made the separation between the two branches of power official. Second, the constitution removed the president’s prerogative to appoint judges.

My study found that constitutional reforms should not give the executive branch any decision-making power over the functioning and organisation of the judiciary.

In Kenya, the Judicial Service Commission, an independent body established under the constitution in 2010, is responsible for all appointments. Judges go through a rigorous process where their legal skills and personal ethics are questioned before they are appointed. This process prevents the president from appointing regime supporters.

Kenya’s reforms also modified the structure of the judiciary by creating the supreme court and diluting the authority of the chief justice. A new special fund gave the judiciary financial autonomy.

The constitution also contains specific provisions regulating how the judiciary settles electoral disputes. Before 2010, it took years to settle them. The constitution established a mandatory timeline. Courts have six months to deal with electoral disputes and 14 days to rule on presidential elections.

Strong judicial networks

These legal mechanisms are not sufficient on their own. They must create the space for civil society groups to interact with the judiciary, and encourage collaboration between activists, lawyers and scholars. By teaming up, these groups bring together more resources, expertise and experience.

They can help courts to resist government pressures. In Kenya, I found that these networks of lawyers, activists and scholars used three strategies to empower courts.

1. Strategic petitions

Lawyers, activists and scholars in Kenya have engaged in strategic litigation to improve the quality of election petitions, pushing courts to depart from the old English precedent, Morgan v Simpson. The 1974 ruling requires plaintiffs to show that electoral fraud occurred, and that the fraudulent behaviour affected an election’s outcome. These Kenyan networks have given courts the opportunity to change their electoral jurisprudence.

In the 2017 presidential election petition filed by Raila Odinga, the supreme court changed its jurisprudence. It established that petitioners had to prove either that electoral fraud took place, or that these irregularities affected election outcomes. This means plaintiffs don’t need to meet the two conditions at the same time, making it easier for opposition candidates to win a case.

2. Judicial training

These networks hold training and professionalisation workshops with the Judiciary Committee on Elections. The sessions help judges to deal with issues such as tight constitutional timelines. They also aim to build a more coherent approach to electoral petitions and discourage arbitrary decisions.

3. Increased scrutiny

The mobilisation of these networks has put the judiciary under intense scrutiny. They can detect inconsistencies or flawed legal reasoning in courts’ decisions. This scrutiny has direct effects on courts’ behaviour.

Most of the judges I interviewed for my paper remember the atrocities committed following Kenya’s 2007 election. For many, the judiciary’s inability to settle the electoral dispute effectively plunged the country into violence. More than 1,100 people died. The conflict almost put the future of judicial institutions into jeopardy.

The supreme court knows that any future misstep could threaten the institution’s survival and the country’s political stability.

The lessons

Policymakers can draw important lessons from the Kenyan case.

First, to prevent political actors from using courts for their own political gain, policymakers must design judicial institutions that cannot be influenced by the government’s agenda. They should identify all pathways through which governments could influence courts – not only through appointments.

Second, by funding and supporting civil society’s judicial activities, donors can help courts uphold electoral integrity and put states on the path to democratisation.

Thalia Gerzso is a postdoctoral fellow at the London School of Economics and Political Science.

Article first appeared on The Conversation.