The results of any national election tell us something important about the country in question. Beyond who won and who voted, we also learn whether the country’s institutions have earned the public’s trust.
Take Kenya, for example, East Africa’s promising power. A decade ago, ethnic violence triggered by a disputed Kenyan election killed an estimated 1,400 people. That conflict centered mainly on rivalries between the Kikuyu and Kalenjin, two of Kenya’s largest ethnic groups, particularly in the Rift Valley region north of Nairobi, where the two groups live side by side. In 2013 the Kikuyu and Kalenjin struck a deal to avoid a repeat of that bloodshed, and a national election that year came off without similar violence.
In August, Kenya held another presidential election. The incumbent, Uhuru Kenyatta, was declared the winner with 54% of the vote. His main challenger and longtime rival, Raila Odinga, claimed the results were hacked and altered, but observers from the U.S., the E.U. and the African Union declared the vote free and fair. Kenya’s election commission certified it.
Then Kenya’s Supreme Court pulled a shocker. On Sept. 1 it ruled that the election didn’t conform to the constitution and has to be rerun. The court is due to publish a report that details the reasoning behind its finding by Sept. 22, and the election commission has set the rerun for Oct. 17. Odinga has threatened to boycott the second vote unless he gets “legal and constitutional guarantees” of a fair election, but the 72-year-old is unlikely to skip what might be his last chance to become President, on the fourth time trying.
Despite the anxiety this episode has generated and the nearly $117 million cost of a rerun, this is a good-news story. It is the first time any court has overturned a presidential election outcome in Africa, and the result has been confusion but not chaos. The deal between the Kikuyu and Kalenjin continues to hold, and Kenyans have shown that the courts can challenge the will of a President and still carry the day. This is another step in the political maturity of a dynamic emerging-market democracy.
It is far from the last step, though. The transition from “rule of men” to “rule of law” takes time. The graft scandal in Brazil, halfway around the world, offers an instructive example of how the institutions of government have to beat back corruption and impunity one case at a time. But on a continent where ethnic violence, spectacular corruption, farcical elections, and the indiscriminate use of force in service of power are still endemic in places, 2017 is likely to be remembered as an important step forward for Kenya and its democracy.
This appears in the September 25, 2017 issue of TIME.