Kenya goes to the polls on Tuesday to elect a new president at the end of a bitter campaign during which its fraught relationship with the International Criminal Court (ICC) has been used as a weapon by both sides.
The roots of that relationship lie in a wave of bloodshed after the 2007 presidential contest in which Mwai Kibaki was re-elected for a second term amid allegations of electoral fraud made by his opponent, Raila Odinga, and confirmed by international observers.
The row sparked some of the worst violence east Africa has ever seen. Some 1,500 people died and 600,000 were forced from their homes in vicious inter-ethnic fighting between Kibaki's tribe, the Kikuyu, and the Kalenjin, formerly their neighbours in the Rift Valley.
The worst – and most emblematic – single loss of life was when a church being used as a refuge was doused in petrol by a rampaging mob and more than 50 people trapped inside were burned to death.
Given the regional economic consequences – particularly for the surrounding landlocked countries, Uganda, Rwanda, Burundi and the Democratic Republic of Congo – mediation was led by UN secretary-general Kofi Annan, and later involved US secretary of state Condoleeza Rice.
Orgy of killing
After an orgy of killing, the result, ironically, was a unity government in which Kibaki remained president, Odinga took the new job of prime minister – and Uhuru Kenyatta, son of Kenya's first president, Jomo Kenyatta, was chosen by Kibaki as deputy PM and finance minister.
It was here that the confrontation between Kenyatta and the ICC, which continues today with the threat of revived charges still hanging over the president, began.
ICC prosecutor Luis Moreno Ocampo charged Kenyatta, along with William Ruto, who would later become his vice-president, with crimes against humanity as "indirect co-perpetrators" of the post-election violence.
And while Kenyatta stood down immediately from his government jobs, he was subsequently elected president in 2013, again in a disputed outcome.
The Kenyatta prosecution should have been the most significant in the ICC’s history, featuring the first sitting president to be held answerable to international justice, but instead it became the court’s greatest failure.
The charges against both Kenyatta and Ruto were dropped in 2015, before the case began, for lack of evidence. The new ICC prosecutor, Fatou Bensouda, alleged the evidence was inadequate because of "obstruction" by the Kenyan government, a charge its attorney general vehemently denied.
After the violence in December 2007 and early 2008, the United Nations warned that unless the perpetrators were punished and the country's institutions were strengthened, old enmities would pass to a new generation and the cycle of violence would recur.
Despite that warning, the ICC has been used as a bogeyman during the current election campaign, with Kenyatta and Ruto appearing together across the country, and Ruto warning that if their old adversary Raila Odinga is elected this time, they will be dispatched summarily to The Hague.
On the other hand, Odinga’s supporters maintain that if Kenyatta wins a second term, there’s little possibility he will ever be tried, even if the ICC revives the charges against him – thus substantiating the view that African heads of state are too often above, or perhaps beyond, the law.
There are many pressing questions this weekend, not least whether Kenya will maintain its membership of the ICC "family" after the election, or will continue behind the scenes to fuel the drive among some African Union states to leave and set up their own alternative regional court.
Most pressing, though, especially following the killing of the electoral commission’s technology director last week, is what will happen after the election result is announced – in a country with such a brutal recent history and so many violent ghosts.