Kenya's 2017 election followed a predictable script. Until it didn't.
Incumbent Uhuru Kenyatta faced longtime rival Raila Odinga. Kenyatta won the August election by 10 percentage points, or 1.4 million votes. Odinga alleged fraud and petitioned the Supreme Court. Violence spread through parts of the country. Dozens were killed. Kenyatta was poised to begin a second term.
Then, everything changed.
In an unprecedented move, three weeks after Kenyans went to the polls, the Supreme Court nullified the election. It said the vote was irregular and illegal, and it ordered a do-over.
Now, little is certain. A new election is slated for October 26, but Odinga has withdrawn from the race. A 2013 Supreme Court judgment says fresh nominations must ensue if a candidate "abandons the electoral quest." But six other candidates were on the ballot in addition to Kenyatta and Odinga, and the constitution says they're entitled to take part in the re-election.
Meanwhile, tensions are high as the government clamps down on protesters in three major cities.
Here's a recap of events leading up to — and following — the election:
Pre-election slaying
July 31 — Authorities discover the body of a senior manager with the Independent Electoral and Boundaries Commission. Christopher Msando, who ran the commission's IT group and oversaw its electronic voting systems, was tortured and slain.
Polls open
August 8 — Polls open for the 2017 general election. Kenyans vote for a president, parliament and regional leaders. Polls suggest either incumbent Uhuru Kenyatta or challenger Odinga Raila could win.
August 10 — Wafula Chebukati, chairman of the IEBC, discloses that an unsuccessful attempt to hack the voting system was made a week before the election.
Kenyatta wins
August 11 — Four days after the election, the IEBC declares Kenyatta the winner, with 54 percent of the vote. Longtime opposition leader Odinga gets 44 percent of the vote. Kenyatta wins by 1.4 million votes. The United States, United Kingdom and other governments around the world congratulate Kenyatta on his victory and praise Kenya for its free and fair election.
August 12 — Violent postelection clashes between police and civilians result in deaths in Nairobi and Kisumu. A stray bullet strikes and kills a 9-year-old girl. Odinga says the election was rigged.
Opposition files petition
August 18 — Odinga files a petition with the Supreme Court to challenge the legitimacy of the election. He alleges vote tampering, fraud and other irregularities. Under Kenyan law, the court must review the case within two weeks.
August 28 — The Supreme Court begins hearing arguments. It grants both Odinga and Kenyatta "read-only access" to IEBC's electronic voting system.
Election annulled
September 1 — The Supreme Court annuls the election, citing "illegalities and irregularities" in the recording and transmission of results. The court blames the IEBC for mishandling the paperwork needed to verify the vote. It also reveals the IEBC refused a court order to access its servers, thereby preventing independent verification of the vote. The court promises to provide details of its ruling in three weeks and stipulates that a new election must be held within 60 days.
September 6 — The IEBC appoints six new people to oversee the re-election, a move criticized by Kenyatta's Jubilee party.
September 15 — More than three-quarters of likely voters feel satisfied with the September 1 annulment, a poll of 1,500 respondents across the country shows.
Court findings detailed
September 20 — The Supreme Court provides details of its historic finding. Justice Philomena Mwilu says the election was "neither transparent nor verifiable." Chief Justice David Maraga says forms to verify the results were incomplete and unsigned. October 17 is set as the new election date.
September 21 — The IEBC moves the election date back nine days, to October 26.
September 26 — Odinga, demanding more substantial reform at the IEBC, calls on CEO Ezra Chiloba and other leaders to resign. Chiloba refuses to step down.
September 28 — The Jubilee party presses for amendments to election law. They want to de-emphasize the role of electronic ballots in vote tallies and require a recount when results are disputed.
Odinga drops out
October 10 — Odinga drops out of the re-election race, alleging that the changes to the IEBC's vendors, processes and leadership needed to ensure the integrity of the election had not been made. Meanwhile, government officials confirm 37 people died in postelection violence the week after Kenyans went to the polls. All but two deaths were caused by police, officials say.
October 11 — Election officials say Odinga did not complete required paperwork to withdraw from the race. They affirm an election will happen October 26. All eight candidates from the August 8 ballot will be part of the rerun. Meanwhile, Odinga calls for daily protests against the government.
October 12 — The government bans protests in the business districts of three cities, including the capital, Nairobi. Officials say the ban will prevent violence. Human rights groups raise alarm bells about blocking the right to peaceful assembly.
October 13 — Speaking at Chatham House in London, Odinga says international observers judge African elections on whether they're peaceful, not free and fair. He says he won't sign the statutory form to withdraw his candidacy since he already expressed his intention to drop out in a letter to the IEBC.