|President Uhuru Kenyatta. (PPS)|
The $3bn Chinese-backed railway project eventually will link a large part of East Africa to a major Indian Ocean port as China seeks to increase trade and influence.
The newly opened line between the capital, Nairobi, and the port city of Mombasa replaces the one built by the British in the 1800s.
President Uhuru Kenyatta says the project will benefit generations to come. Critics have said the project is overpriced and could be a conduit for corruption.
Kenyatta has dismissed those claims.
The railway is part of China's "Belt and Road" project, its largest foreign initiative to date with multibillion-dollar investments in ports, railways and other facilities.
Poor infrastructure has hurt economic activity through much of Africa.