The first railway in Kenya was the Uganda Railway, running inland from the port of Mombasa. As the railway’s name suggests, it was planned to connect Uganda with the coast; but costs and engineering difficulties caused the project to be curtailed and the first terminus was in actually in Kenya, on the shores of Lake Victoria, with connection to Uganda by steamboat. The 580 mile (930km) line from Mombasa to Port Florence (present day Kisumu) on Lake Victoria opened in sections between 1898 and 1901. The originally planned line into Uganda itself, now taking the form of a branch from Nakuru around the northern end of Lake Victoria, had to wait until after the First World War before work commenced, and was not completed through to Kampala until 1931.
The chosen gauge for the railway was metre gauge, which had been used with some success in India. Through running with other African railways was not at that time envisaged, although fortuitously the gauge was the same as that used by the railways of neighbouring German East Africa (Tanzania).
Various branches were constructed from the main line, notably a link opened in 1924 from Voi to Taveta on the border with Tanganyika (Tanzania), connecting with the Tanga line of of that country’s railways. This international link is now closed.
In 2016, it was announced that a new light rail system would be constructed in Nairobi.
In 2017, a new 472km, standard (1435mm) gauge railway opened between Mombasa and Nairobi. Construction of a 120km extension of this railway from Nairobi to Naivasha commenced in 2016. Detailed plans are in place for a further 369km from Naivasha to Malaba. Ultimately, the new railway will continue to Kampala in Uganda and effectively replace the existing route.
Flag image from CIA World Factbook