Kenya may not be as sexy as South Africa, but as a haven of stability and prosperity in eastern Africa the quality of its democracy matters. Its northern and western neighbours—Sudan, Ethiopia, Uganda and Somalia—suffer in various degrees from war, tribal conflict, government repression, separatism and all that follows. From the countries of the war-ravaged Great Lakes region, such as Congo and Rwanda, Nairobi appears an oasis of calm. But this success is relative. Kenya itself has long been beset by bad governance, corruption and tribalism. Despite receiving billions of dollars of aid, most of its 35m people remain poor. True, few countries have had to contend with the ethnic complexity of Kenya, which has more than 40 recognised tribes. Nor does erratic weather help a largely rural economy. But the main culprit is a system of politics in which a ruling class has hogged most of the cake for itself.
His leading opponent, Raila Odinga, who is 14 years younger, is a more energetic figure who now disavows his past socialism and East German education while still appealing to the poor and to some of the marginal tribes, particularly his own Luo in the west and the country's Muslims in the east. Mr Kibaki, by contrast, has long been at the heart of the Kenyan business establishment which his own Kikuyu tribe, the country's largest and richest, dominates. Although polls give Mr Odinga the edge, the president's media machine may help him catch up by the vote on December 27th. Both candidates have flaws: Mr Kibaki's departure is overdue, but the more energetic Mr Odinga's campaign carries a divisive flavour.
Whoever wins, what matters next is that the result should be accepted by the loser and Kenyans should be seen to endorse the principle of peaceful competition. Most of Africa has left behind the era of the one-party state, but its people have yet to be fully persuaded that multi-party politics need not be chaotic. South Africa's ruling party seems unhappy to have submitted itself to an internal contest that has humiliated President Mbeki, who himself seems loth to badger neighbouring Zimbabwe's dictatorial Robert Mugabe into holding fair elections. But if a country as complex and poor as Kenya can hold genuine elections without civil strife, then any country in Africa can. This is its chance to set an example.