Giant crocodile fossils have been discovered in Kenya, dating from the Mesozoic Era, over 200 million years ago. The fossils were found in an excavation conducted by a team from the University of Utah and the National Museums of Kenya in July–August 2004 at Lokitaung Gorge, near Lake Turkana.
Fossils found in East Africa suggest that primates roamed the area more than 20 million years ago. Recent finds near Kenya's Lake Turkana indicate that hominids such as Homo habilis (1.8 and 2.5 million years ago) and Homo erectus (1.8 million to 350 000 years ago) are possible direct ancestors of modern Homo sapiens and lived in Kenya during the Pleistocene epoch. In 1984, one particular discovery made at Lake Turkana by famous palaeoanthropologist Richard Leakey and Kamoya Kimeu was the skeleton of a Turkana boy, belonging to Homo erectus from 1.6 million years ago. Previous research on early hominids is particularly identified with Mary Leakey and Louis Leakey, who were responsible for the preliminary archaeological research at Olorgesailie and Hyrax Hill. Later work at the former was undertaken by Glynn Isaac.
Kenya has been inhabited by people for as long as human history has existed.
The first inhabitants of present-day Kenya were hunter-gatherer groups, akin to the modern Khoisan speakers. These people were later replaced by agropastoralist Cushitic speakers from the Horn of Africa. During the early Holocene the regional climate shifted from dry to wetter climatic conditions, providing an opportunity for the development of cultural traditions, such as agriculture and herding, in a more favourable environment.
Around 500 BC Nilotic speaking pastoralists (ancestral to Kenya's Nilotic speakers) started migrating from present-day Southern Sudan into Kenya. Nilotic groups in Kenya include the Samburu, Luo, Turkana, Maasai.
By the first millennium AD, Bantu-speaking farmers moved into the region. The Bantus originated in West Africa along the Benue River in what is now eastern Nigeria and western Cameroon. The Bantu migration brought new developments in agriculture and iron working to the region. Bantu groups in Kenya include the Kikuyu, Luhya, Kamba, Kisii, Ameru, Aembu, Ambeere,[Wadawida-Watuweta,[Wapokomoand Mijikenda among others.
Remarkable prehistoric sites in the interior of Kenya include the archaeoastronomical site Namoratunga on the west side of Lake Turkana and the walled settlement of ThimLich Ohinga in Nyanza Province.
Arab traders began frequenting the Kenya coast around the 1st century AD. Kenya's proximity to the Arabian Peninsula invited colonisation, and Arab and Persian settlements sprouted along the coast by the 8th century.
The Kenyan coast had served host to communities of ironworkers and communities of subsistence farmers, hunters and fishers who supported the economy with agriculture, fishing, metal production and trade with foreign countries.
The Great Mosque of Kilwa Kisiwani, one of the many mosques built by the Persian founders of the Kilwa Sultanate.
The Kilwa Sultanate was a medieval sultanate, centred at Kilwa in modern-day Tanzania. At its height, its authority stretched over the entire length of the Swahili Coast, including Kenya. It was founded in the 10th century by Ali ibn al-Hassan Shirazi, a Persian Prince of Shiraz. The Persian rulers would go on to build elaborate coral mosques and introduced copper coinage.
During this period, Arabs from southern Arabia settled on the coast. They established many new autonomous city-states, including Mombasa, Malindi and Zanzibar. The Arab migrants also introduced Islam and the Omani dialect of Arabic to the area. This blending of cultures left a notable Arabian influence on the local Bantu Swahili culture and language of the coast. The Arabs built Mombasa into a major port city and established trade links with other nearby city-states, as well as commercial centers in Persia, Arabia, and even India. By the 15th-century, Portuguese voyager Duarte Barbosa claimed that "Mombasa is a place of great traffic and has a good harbour in which there are always moored small craft of many kinds and also great ships, both of which are bound from Sofala and others which come from Cambay and Melinde and others which sail to the island of Zanzibar."
In the centuries preceding colonisation, the Swahili coast of Kenya was part of the east African region which traded with the Arab world and India especially for ivory and slaves (the Ameru tribe is said to have originated from slaves escaping from Arab lands sometime around the year 1700). Initially these traders came mainly from Arab states, but later many came from Zanzibar (such as Tippu Tip). Close to 90% of the population on the Kenya coast was enslaved. Swahili, a Bantu language with Arabic, Persian, and other Middle Eastern and South Asian loanwords, later developed as a lingua franca for trade between the different peoples.
Throughout the centuries the Kenyan Coast has played host to many merchants and explorers. Among the cities that line the Kenyan coast is the City of Malindi. It has remained an important Swahili settlement since the 14th century and once rivalled Mombasa for dominance in this part of East Africa. Malindi has traditionally been a friendly port city for foreign powers. In 1414, the Arab Sultan of Malindi initiated diplomatic relations with Ming Dynasty China during the voyages of the explorer Zheng He. Malindi authorities welcomed Portuguese explorer, Vasco da Gama, in 1498.