The first direct elections for Africans to the Legislative Council took place in 1957. Despite British hopes of handing power to "moderate" African rivals, it was the Kenya African National Union (KANU) of Jomo Kenyatta that formed a government shortly before Kenya became independent on 12 December 1963, on the same day forming the first Constitution of Kenya. During the same year, the Kenyan army fought the Shifta War against ethnic Somalis who wanted Kenya's Northern Frontier District joined with the Republic of Somalia. The Shifta War officially ended with the signature of the Arusha Memorandum in October 1967, but relative insecurity prevailed through 1969. To discourage further invasions, Kenya signed a defence pact with Ethiopia in 1969, which is still in effect.
On 12 December 1964 the Republic of Kenya was proclaimed, and Jomo Kenyatta became Kenya's first president. At Kenyatta's death in 1978, Daniel arap Moi became President. Daniel arap Moi retained the Presidency, being unopposed in elections held in 1979, 1983 (snap elections) and 1988, all of which were held under the single party constitution. The 1983 elections were held a year early, and were a direct result of an abortive military coup attempt on 2 August 1982.
The abortive coup was masterminded by a low ranked Air Force serviceman, Senior Private Hezekiah Ochuka and was staged mainly by enlisted men in the Air Force. The attempt was quickly suppressed by Loyalist forces led by the Army, the General Service Unit (GSU) — a paramilitary wing of the police — and later the regular police, but not without civilian casualties. This event led to the disbanding of the entire Air Force and a large number of its former members were either dismissed or court-martialled.
The election held in 1988 saw the advent of the mlolongo (queuing) system, where voters were supposed to line up behind their favoured candidates instead of a secret ballot. This was seen as the climax of a very undemocratic regime and it led to widespread agitation for constitutional reform. Several contentious clauses, including one that allowed for only one political party were changed in the following years. In democratic, multiparty elections in 1992 and 1997, Daniel arap Moi won re-election. In 2002, Moi was constitutionally barred from running, and Mwai Kǐbakǐ, running for the opposition coalition "National Rainbow Coalition" — NARC, was elected President. Anderson (2003) reports the elections were judged free and fair by local and international observers, and seemed to mark a turning point in Kenya's democratic evolution.
In mid-2011, two consecutive missed rainy seasons precipitated the worst drought in East Africa seen in 60 years. The northwestern Turkana region was especially affected, with local schools shut down as a result. The crisis was reportedly over by early 2012 due to coordinated relief efforts. Aid agencies subsequently shifted their emphasis to recovery initiatives, including digging irrigation canals and distributing plant seeds.