The place where Nairobi today was originally a part swamp occupied by the Masaai, a nomadic tribe, and the Kikuyu people. On the arrival of Uganda Railway, this site was selected for store depot, shunting ground and camping ground for the Indian labourers.
In 1900 the place was rebuilt due to an outbreak of plague. Later in 1907, Nairobi turned into a commercial centre and became the capital of British East Africa by replacing Mombasa. Nairobi flourished under the British rule and also became a home for many Britons. In 1919, it was declared as a municipality. In 1921, Harry Thuku established the Young Kikuyu Association and began organizing protests against the British; he was arrested on 14th March 1922. There was a general strike by thousands of Africans in Nairobi, and the British government started shooting the Protestants. The Massacre shocked people worldwide, along with the British.
Towards the end of World War II, the strife resulted in a Mau Mau Uprising. There was pressure on the British from the local people that led to Kenyan Independence in 1963. Nairobi became the capital of the new republic.