A series of unrelated but important events the past few days could have significant repercussions for the tightening race.
Kenya experienced a remarkable, if seemingly coincidental, series of events this weekend. Nine people were beheaded by suspected al-Shabaab militants. The Secretary of Internal Security died suddenly. President Uhuru Kenyatta appeared to accuse the judiciary of meddling in the elections. And the opposition leader Raila Odinga was briefly hospitalised.
All just a month before Kenya heads to the polls on 8 August in what is anticipated to be a tense vote.
These various events were unrelated to one another, but together, they underscore the immense challenges Kenya faces as the elections approach. Combatting terrorism, maintaining national security, and ensuring free, fair and peaceful elections were all likely to prove difficult. This weekend showed just how difficult they may turn out to be.
Insecurity on the coast
On Friday night, nine people were beheaded in Jima village in Lamu County. The attack was brutal, but it was just the latest of a slew of assaults in the area believed to have been carried out by al-Shabaab.
Two days earlier, the Islamist group killed four officers at the Pandaguo Police post, about two kilometres from Jima. On 27 June in Lamu East, eight people died after a police vehicle ran over an explosive suspected to have been planted by the militants.
In response to the latest attack, the government evacuated villagers living in the area and imposed a 90-day curfew in parts of Lamu, Garissa and Tana River counties. On Monday, it announced intensified air strikes in Boni Forest where militants are believed to be hiding out.
The response to al-Shabaab has already been a talking point in the election. Odinga has vowed to withdraw troops from Somalia and repeatedly criticised the government for failing to curb the domestic threat. Kenyan troops have been fighting al-Shabaab in Somalia since 2011, and the latest uptick in attacks will likely increase scrutiny of this intervention in the campaigns.
Nkaissery's sudden death
The curfew was imposed by Fred Matiang'i, the interim Secretary for the Internal Security and Coordination, in his first full day on the job. On Saturday morning, the previous Interior Cabinet Secretary, Joseph Nkaissery, was pronounced dead after collapsing at his home. An investigation into his death has been opened, and leaders from all parties mourned the loss.
Nkaissery was the government's senior security official and a highly divisive and powerful figure. He was a general in the armed forces since the 1970s before joining politics.
As minister, he led Kenya's counterterrorism efforts. He was in charge of the response to the Garissa University attack in April 2015 in which 148 students were killed. Afterwards, he admitted that vital intelligence was ignored and that security forces failed to coordinate. Nkaissery also faced criticism for responding ineffectively to allegations of misconduct and human rights violations by security forces during subsequent operations.
Nkaissery further courted controversy in December 2015 when he threatened to arrest journalists making accusations against the police. The minister was additionally a major figure behind controversial efforts to repatriate Somali refugees living in Kenya's Dadaab camp.
Nkaissery's death is a major loss to President Kenyatta. It has created a vacuum in national security as well as within politics among the Maasai. Nkaissery was the most senior Maasai in government, a leader within the community, and was considered extremely important to delivering Maasailand votes for the president. The day before his death he had been on the campaign trail with Kenyatta, attending a prayer rally. What his passing means for the incumbent's campaign remains to be seen.
Kenyatta attacks judiciary as polls tighten
The event this weekend with perhaps the most long-term effects on the elections was a decision by the high court and the president's subsequent response.
On Friday, the court nullified the tender to print ballot papers, which had been awarded to a Dubai-based firm. The opposition claimed that the company has ties to Kenyatta.
In their ruling, the judges did not refer to any such connections, but stated that "the failure to consult all the presidential candidates was unfair" and concluded that the Independent Electoral and Boundaries Commission (IEBC) had not carried out the tender adequately. The court ordered that the process be restarted.
Both the government and IEBC have said they will appeal the ruling. But the court's ruling was also met with escalated rhetoric. At a rally on Sunday, Kenyatta declared: "I want to tell those in the courts that because we have respected you for a long time we are not fools. We cannot accept the courts to be used by those not interested in the elections to frustrate IEBC."
Deputy President William Ruto also appeared to accuse Chief Justice David Maraga, who was only appointed in October, of meddling. This prompted the judge to respond with a statement that warned: "We in the Judiciary are open to constructive engagement, including being criticised. However, when political leaders cast aspersions on the administration of justice based on a misinterpretation of my statements, it has the potential to impair public confidence in our courts."
The most direct effect of the high court decision is that the election may be postponed, as it may prove difficult for voting papers to be printed in time for 8 August. But more worryingly, it may weaken confidence in both the IEBC and court system.
Mistrust in the courts was an important factor in the deadly 2007/8 election violence. Moreover, after the 2013 elections, Odinga filed a Supreme Court case against the electoral commission, alleging voter irregularities and fraud. The Court ruled unanimously that the election was fair, but questions over the competency of the commission and legitimacy of the ruling remained, with the Law Society of Kenya finding faults with the decision.
The final dramatic event of the weekend occurred on Sunday night when the main opposition leader Raila Odinga was hospitalised in Mombasa as a result of food poisoning. Although the 72-year old presidential candidate was quick to assure voters he is healthy and "fit as a fiddle", a video of him on a gurney circulated in local media, causing panic. In 2010, Odinga had surgery to remove fluid from his brain, and the latest episode may raise additional concerns about his health as the race intensifies.
The latest polls released last week show Kenyatta maintaining a five-point lead over Odinga. But this gap has narrowed significantly in recent months from what was once a 30-point gap.
Given how much is at stake, the European Union has warned of possible clashes, stating that, "it is no secret there are concerns about the possible outbreak of violence". In 2007-8, approximately 1,200 people were killed and 600,000 displaced during post-election violence after the result was disputed. Communities in some of the hardest hit areas have yet to reconcile or see justice for crimes committed.
Both Kenyatta and Odinga have recently accused each other of instigating that inter-ethnic conflict, for which Kenyatta and Ruto were charged by the International Criminal Court before both cases were dropped for insufficient evidence.
Human Rights Watch also warned today that ongoing violence, displacement and insecurity in the Rift Valley could stop thousands of people from voting.
In this tense environment, this weekend's events come at a difficult time. The government's war of words with the judiciary, Odinga's hospitalisation, Nkaissery's sudden death, and the rise in insecurity may be unrelated. But they all add to the uncertainty across various already fragile dimensions of Kenya's political landscape as crucial elections approach.