The Mombasa–Nairobi Standard Gauge Railway (SGR) is a standard gauge railway that connects the port city of Mombasa to Kenya's capital city Nairobi. The railway replaces the parallel and colonial Uganda Railway that was originally built during the British colonial rule in the 19th century. Under the East African Railway Master Plan, the Mombasa–Nairobi SGR will link up with other standard gauge railways that are being built in East Africa. Construction is already under way on Phase II of the Kenya SGR, which will extend the railway to the Uganda border by 2021.
The prime contractor on the railway was the China Road and Bridge Corporation. The project is estimated to cost US$3.8 billion, with 90% supplied by a loan from the Exim Bank of China and 10% coming from the Kenyan government. 30,000 Kenyans were hired to work on the railway, which represents 90% or the workers. However, in October 2014, more than two hundred residents in Voi, a town located 142km (89 miles) inland from Mombasa, halted traffic with burning tyres to demand jobs from the Chinese company contracted to build a section of a railway in the area. The design capacity of the railway is 25 million tonnes per year.
May 30, 2017 marked the launch of the Mombasa-Nairobi Standard Gauge Railway (the Madaraka Express) in Kenya. The Chinese government and official media have hailed the completion of the project as another success of the East Africa regional railway network, following the Addis Ababa-Djibouti Railway, which launched operation on October 5, 2016. If things proceed smoothly, the Mombasa-Nairobi line will eventually link Kenya, Tanzania, Uganda, Rwanda, Burundi, and even South Sudan and Ethiopia. The railway has been expensive but it is well seen in the country. A big political success with a positive effect on the economy of Kenya. Mombasa is of course the main port city. The port of Mombasa is doing nearly 30 million tonnes per year in cargo traffic. The railway will continue in a second phase from Nairobi to Malaba (the border town) through Kisumu in the shore of Lake Vitoria.
Indeed, the new line will decrease journey times for Kenyans; shortening the travel time from Mombasa to Nairobi from over ten hours to five hours, with freight trains completing the journey in eight hours. It also represents the biggest investment in rail infrastructure since 1901, with the rail line steadily fixed onto concrete sleepers and running for the better part on raised mounds of earth. Criticism in the Western press (such as The Economist, that complained of the cost) have been seen as signals of envy of new Chinese power. The new railway bisects Tsavo National Park. It is built on a steep man-made embankment that elephants cannot cross. The railway has only a few bridges under which elephants and giraffes can pass, so in other places they are forced to use underpasses constructed where the animals were believed to migrate. Soon another obstacle may block their path. Kenya is considering building a six-lane highway alongside the rails. Conservationists with Save the Elephants, Tsavo Trust, and the Kenya Wildlife Service hope to pressure the government to ensure any future highway will include overpasses—in the right spots so as not to disrupt wild animal movement further. 
The National Lands Commission (NLC) has said the Government will offer reasonable compensation to land owners affected by the Standard Gauge Railway (SGR) not based on rates being offered by other commercial entities offering to purchase the land. Addressing locals at Kasemeni Ward in Kinango NLC Chair, Dr Muhammad Swazuri said SGR is a public project that has immense benefits for people of the larger East African region. "We are pursuing this land for public use and not as a profitability venture. We therefore cannot offer what private investors are offering for land they acquire here," he said. Swazuri said NLC does not want a situation where Government projects stall because of land unavailability. At the meeting, 220 letters that NLC had given to land owners were returned after owners protested low compensation and the chairman said they will, this week, issue fresh and properly worded letters detailing what is being compensated. "We shall be clear on the breakdown which includes value of land and cost of any improvements including buildings and crops or plants on the plots to be hived off for the SGR project," he said. In the meantime, Council of Governors Vice chairman, Salim Mvurya, has hit out at Mombasa County Commissioner Nelson Marwa who he accused of branding as inciters - county leaders voicing their concern over the SGR compensation. "The Constitution is very clear on the need to dialogue and especially on matters pertaining to compensation where people have to move to pave way for Government projects. As county leaders we will not stop speaking for our people," Mvurya said. The governor warned residents to be wary of land brokers who have invaded the area due to ongoing mega projects like the SGR and the Dongo Kundu by pass projects. On his part, Education Executive Mangale Munga Chiporomodo welcomed remarks by Swazuri that all schools facing relocation will have their costs borne by SGR. He said schools to be affected within Kasemeni division include Bonje Secondary School, Mprirani and Mariakani Roman Catholic Primary School. Some land owners held protests to say they were being offered too little, a move that might frustrate the already ongoing project. “They are offering me only 28,000 shillings ($288.51) for my two-room house, which they will demolish. How do I build another one elsewhere with that little cash?” Said by one of the protesters.
Near to Nairobi, the railway cuts through Nairobi National Park, south of the city, a 117 square kilometre wilderness, where buffalo and rhino roam just seven kilometres from the city centre. There were complaints against this, but Kenya's wildlife service, the land commission and national railways authorities agreed to build long bridges stretching parts of the park. Paul Muya, spokesman for the Kenya Wildlife Service (KWS), agreed with the solution. 
However, findings in 2016 by the organization Save the Elephants, which was authorized by the Kenya Wildlife Service to survey the effects of another SGR project in southern Kenya’s Tsavo National Park, shows that, faced with the newly constructed railway, some elephants in Tsavo have successfully used the underpasses and culverts to cross the tracks, but others have avoided them. Giraffe have almost entirely stayed away from the underpasses, and according to Save the Elephants, there has been a significant increase in elephant deaths from train and vehicle collisions during railway construction.
After some months of functioning, both as a passenger and cargo railway, herders are known to have broken barriers for their own animals to pass, and "vandals" are blamed for taking metals away in large quantities.