Contagion of suspicion and rage spreads in a flicker and a crowd becomes a deadly mob
Suppose they organised an election and nobody came? In the polling station the returning officer was at his wits' end. "Me, I am already being affected by the gas," he said, "I am scared. It is not conducive. We cannot do our work." This belonged to the great statements of the blindingly obvious. Rocks were smashing through nearby windows and bouncing off the corrugated roof. Gunshots were echoing and tear gas drifted in from the alley. Another day of routine rioting in Kibera, Africa's largest slum, and a stronghold of the Kenyan opposition.
Most of the election officials were young, there to do the job they were paid for - but with nobody turning up to vote. On the way down the alley, a woman told us she had been visited by a mob the night before.
"They will burn my house and kill me if I vote" she said.
I counted several hundred police. They had clubs, water cannon, tear gas cannisters and automatic rifles. But the locals knew the cops would leave and then the retribution would start. So the ballot boxes at Olympic primary school stayed empty.
The rioters were beckoning us to speak with them. There was a lull in the stone-throwing and tear-gassing. We left the police lines and walked down the alley into no-man's land. The geography of this place is infinitely confusing to the outsider. The unpaved streets wander off haphazardly, and it takes no effort to get hopelessly lost.
Then sometimes it just happens that the mood shifts. Like a change in the direction of the wind, there is no warning. You are in the middle of one crowd, then it becomes a very different crowd. There are the same young men, but suddenly you do not recognise them. The contagion of rage and suspicion spreads from the individual to the group in the flicker of a thought.
Of all the scenarios in conflict zones, it is the danger of the unstable mob that keeps me awake at night. Suddenly they were all around us. The police had retreated to the top of the street and were gauging their next move. The rioters had the advantage now. Stones flew over our heads.
"It's a sham. This whole election is rigged," one of the men shouted. "Tell the world it is a joke election," said another. Then a shout rose up: "Take cover!" The police were loading up with tear gas. The cartridge landed well behind us but the acrid fumes still drifted forward on the wind. We coughed and heaved. After a few minutes the air cleared and the stone-throwing resumed.
Then it happened. He had been standing slightly apart from the main group, a tall and intense-looking young man. "You Mzungu (whites) and your ambassadors try to tell us to have this election. Don't you come here and tell us this." I smiled and tried to speak words of calm. But he was past being reasoned with.
The words poured in a bitter torrent. I saw others in the group turn and listen to him. He jabbed his finger at our cameraman. Instinct took over. We started to back up the lane towards the police, praying they would restrain themselves until we reached our vehicle.
The crowd pulled back. The bitter young man vanished. A local journalist looked at his watch. "It's noon," he said, "everybody is taking a break."
The following day, a mob attacked opposition supporters in another Nairobi settlement. This time they came with machetes. One image showed a man being beaten and hacked on the ground. The number of deaths has been comparatively small. The violence has been nothing on the scale that followed the 2007 elections, when more than a thousand were killed. But the atmosphere here is toxic. The calm is on the surface.
Politics at the top in Kenya is, and always has been, a game of elites. Electoral victory means control of the coffers. Money, and the power of patronage it allows, is the most pernicious dynamic in the story of Kenyan democracy.
There have been decades of corruption and misrule accompanied by the shameless manipulation of ethnic rivalries by leading politicians.
Add to that the chilling influence of secret operatives who target senior election officials. One was tortured and murdered before the first round of voting, another fled the country last week because of threats to her life.
On the eve of the election, the judiciary was threatened. The deputy chief justice was due to join her colleagues ruling on a petition seeking postponement of the election when her bodyguard was shot and wounded. She didn't appear in court. In fact, only two of the court's seven judges turned up. The case was adjourned.
So yes, it looks bleak for real democracy here. And that is a great shame.. Across this region, countries that have made progress on human rights and accountable government are sliding back towards authoritarianism. The new 'big men' of Africa are more subtle than the old. They use constitutional change and new laws to entrench their rule.
There are no cartoon monsters, like Idi Amin of Uganda or Emperor Bokassa of the Central African Republic. They don't crown themselves Emperor or order the murder of school children. Slick western PR firms are hired to burnish their image.
There is another big difference between the old days and the present. In the Cold War era, when I first reported from Africa, there was nothing like the vibrant civil society that exists now. For all the determination of the new 'big men' to monopolise power, I don't believe the tens of thousands of human rights campaigners, of many organisations, will allow them to succeed. But prepare for a very long struggle. Forget about framing this continent - as did one magazine - as a narrative of either The Hopeless Continent or Africa Rising. Neither reflects the complex reality.
Let me give you a Kenyan example that gladdens my heart. It has a strong Irish connection too. On the eve of the election I went to the Nairobi offices of the group Shalom, where two Irish priests, Fr Patrick Devine from Roscommon, and Fr Oliver Nunan of Cork city, work with a team of conflict preventers from across the country's tribal patchwork.
Every day they are busy in the flashpoint areas. Their phones ring constantly.
"It's only by being consistent and having highly trained people, and by developing relationships on the ground, that you can get results," said Fr Devine. He told me proudly that everyone on the team was qualified to MA level in peace studies. They were focused, calm, objective. No tribalist politician was going to sway them. Kenya needs them in its slums and beleaguered western villages where tension is rising by the day. What they do here matters to all of Africa.
- Fergal Keane is the BBC's Africa Editor