According to Wikipedia the Portuguese were the first Europeans to explore Kenya, Vasco da Gama having visited Mombasa in 1498. Portuguese rule centred mainly on the coastal strip ranging from Malindi to Mombasa. The Portuguese colonial presence in East Africa officially begins after 1505, when flagships under the command of Don Francisco De Almeida bombarded and plundered Kilwa, an island located in what is now southern Tanzania. Following this, the Portuguese sacked Mombasa following the refusal of the town's leadership to pay tribute. Attacks followed on Hoja (now known as Ungwana, located at the mouth of the Tana River), Barawa, Angoche, Pate and other coastal towns until the western Indian Ocean was a safe haven for Portuguese commercial interests and tribute was paid to the Portuguese crown by all of the city-states along the East African coast. The Portuguese colonial presence in East Africa served two primary purposes: the extraction of tribute from coastal polities and the control of trade within the Indian Ocean through piracy. The first objective was only mildly successful by all accounts as local East African rulers rebelled against the Portuguese frequently. However, Portuguese naval vessels were very disruptive to commerce within the western Indian Ocean and were able to demand high tariffs on items transported through the sea due to their strategic control of ports and shipping lanes. The construction of Fort Jesus in Mombasa in 1593 was meant to solidify Portuguese hegemony in the region, but their influence was clipped by the British, Dutch and Omani Arab incursions into the region during the seventeenth century. The Omani Arabs posed the most direct challenge to Portuguese influence in East Africa and besieged Portuguese fortresses, openly attacked naval vessels and completely expelled the Portuguese from the Kenyan and Tanzanian coasts by 1730.
Omani Arab colonization of the Kenyan and Tanzanian coasts brought the once independent city-states under closer foreign scrutiny and domination than was experienced during the Portuguese period. Like their predecessors, the Omani Arabs were primarily able only to control the coastal areas, not the interior. However, the creation of clove plantations, intensification of the slave trade and relocation of the Omani capital to Zanzibar in 1839 by Seyyid Said had the effect of consolidating the Omani power in the region. Arab governance of all the major ports along the East African coast continued until British interests aimed particularly at ending the slave trade and creation of a wage-labour system began to put pressure on Omani rule. By the late nineteenth century, the slave trade on the open seas had been completely outlawed by the British and the Omani Arabs had little ability to resist the British navy’s ability to enforce the directive. The Omani presence continued in Zanzibar and Pemba until the 1964 revolution, but the official Omani Arab presence in Kenya was checked by German and British seizure of key ports and creation of crucial trade alliances with influential local leaders in the 1880s. However, the Omani Arab legacy in East Africa is currently found through their numerous descendants found along the coast that can directly trace ancestry to Oman and are typically the wealthiest and most politically influential members of the Kenyan coastal community.
Kenya-Uganda railway near
Mombasa, about 1899
However, most historians consider that the colonial history of Kenya dates from the establishment of a German protectorate over the Sultan of Zanzibar's coastal possessions in 1885, followed by the arrival of the Imperial British East Africa Company in 1888. Incipient imperial rivalry was forestalled when Germany handed its coastal holdings to Britain in 1890. This followed the building of the Kenya-Uganda railway passing through the country. Although this was also resisted by some tribes, notably the Nandi led by Orkoiyot Koitalel Arap Samoei for ten years from 1895 to 1905, these did not stop the British building the railway. It is believed that the Nandi were the first tribe to be put in a native reserve to stop them from disrupting the building of the railway. During the railway construction era, there was a significant inflow of Indian peoples who provided the bulk of the skilled manpower required for construction. These people remained in Kenya and formed the core of several distinct Indian communities such as the Ismaili muslim and Sikh communities.
At the outbreak of the First World War in August 1914, the governors of British East Africa (as the Protectorate was generally known) and German East Africa agreed a truce in an attempt to keep the young colonies out of direct hostilities. However Lt Col Paul von Lettow-Vorbeck took command of the German military forces, determined to tie down as many British resources as possible. Completely cut off from Germany by the British Navy, von Lettow conducted an effective guerrilla warfare campaign, living off the land, capturing British supplies, and remaining undefeated. He eventually surrendered in Zambia eleven days after the Armistice was signed in 1918. To chase von Lettow the British deployed Indian Army troops from India and then needed large numbers of porters to overcome the formidable logistics of transporting supplies far into the interior by foot. The Carrier Corps was formed and ultimately mobilised over 400,000 Africans, contributing to their long-term politicisation.
During the early part of the twentieth century, the interior central highlands were settled by British and other European farmers, who became wealthy farming coffee and tea. By the 1930s, approximately 30,000 white settlers lived in the area and were offered undue political powers because of their effects on the economy. The area was already home to over a million members of the Kĩkũyũ tribe, most of whom had no land claims in European terms (but the land belonged to the ethnic group), and lived as itinerant farmers. To protect their interests, the settlers banned the growing of coffee, introduced a hut tax, and the landless were granted less and less land in exchange for their labour. A massive exodus to the cities ensued as their ability to provide a living from the land dwindled.
In 1951, Sir Horace Hector Hearne became Chief Justice in Kenya (coming from Ceylon, where he had been Chief Justice and sat in the Supreme Court, Nairobi). He held that position until 1954 when he became an Appeal Justice of the West African Court of Appeal. On the night of the death of George VI, 5 February 1952, Hearne escorted the Princess Elizabeth, as she then was, to a state dinner at the Treetops Hotel, which is now a very popular tourist retreat. It was there that she "went up a princess and came down a Queen".[citation needed] She returned immediately to England, accompanied by Hearne.
From October 1952 to December 1959, Kenya was under a state of emergency arising from the Mau Mau rebellion against British rule. The governor requested and obtained British and African troops, including the King's African Rifles. In January 1953, Major General Hinde was appointed as director of counter-insurgency operations. The situation did not improve for lack of intelligence, so General Sir George Erskine was appointed commander-in-chief of the colony's armed forces in May 1953, with the personal backing of Winston Churchill. The capture of Warǔhiǔ Itote (a.k.a. General China) on 15 January 1954 and the subsequent interrogation led to a better understanding of the Mau Mau command structure. Operation Anvil opened on 24 April 1954 after weeks of planning by the army with the approval of the War Council. The operation effectively placed Nairobi under military siege, and the occupants were screened and the Mau Mau supporters moved to detention camps. May 1953 also saw the Home Guard officially recognized as a branch of the Security Forces. The Home Guard formed the core of the government's anti-Mau Mau strategy as it was composed of loyalist Africans, not foreign forces like the British Army and King's African Rifles. By the end of the emergency the Home Guard had killed no fewer than 4,686 Mau Mau, amounting to 42% of the total insurgents. The capture of Dedan Kimathi on 21 October 1956 in Nyeri signified the ultimate defeat of the Mau Mau and essentially ended the military offensive.