The word Nairobi derives from a water hole known in Maasai (an Eastern Nilotic language) as Enkare Nyirobi, which means "cool waters." Nairobi, which was a swamp area, was founded in 1899 and was first a railway camp for the Uganda Railway.
The city became Kenya’s capital, which was Mombasa initially, and it also became the capital of the British East Africa Protectorate in 1905. With the spread of plagues in the early 1900s, the town was burnt down and had to be rebuilt. Having a railroad system in the system helped it to have drastic growth, becoming the second largest city in Kenya behind Mombasa.