Under the terms of the agreement, Exim Bank of China will provide 90 per cent of the cost to replace the crumbling British colonial-era line with a 609.3 kilometre standard-gauge link and Kenya the remaining 10 per cent.
Construction is due to start in October and take three-and-a-half years to complete, with China Communications Construction Co as the main contractor.
Once the Mombasa-Nairobi line is completed, construction would begin to link east Africa's largest economy with Kampala, Kigali, Bujumbura and Juba.
"This project demonstrates that there is equal cooperation and mutual benefit between China and the East African countries, and the railway is a very important part of transport infrastructure development," Chinese Premier Li Keqiang said.
Also Read
Li has been on a four-country tour of Africa, his first since taking office last year, with the world's second-biggest economy keen to boost its presence on the continent to find new markets and opportunities.
Museveni also took a swipe at Western donors who have been critical of his leadership -- including government corruption and his recent signing of draconian anti-gay legislation.
"We are happy to see that China is concentrating on the real issues of development," Museveni said.
"They don't give lectures on how to run local governments and other issues I don't want to mention," he said.