Britannica Sources used in this answer

Why is Nairobi Kenya’s capital city?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

Nairobi became the capital of Kenya primarily due to its development as a colonial railway settlement. The city originated in the late 1890s, and when the railhead reached the site in 1899, the British colonial administration transferred the capital of the Ukamba province there from Machakos.1

In 1905, Nairobi was officially designated as the capital of the British East Africa Protectorate. Its strategic location as a trading centre and its role as a governmental hub facilitated its growth into one of the largest cities in tropical Africa. Following Kenya’s independence in 1963, Nairobi was retained as the nation's capital.1