Kenya has opened a major new railway between the port city of Mombasa and the capital, Nairobi, 18 months early.
President Uhuru Kenyatta said during the launch that the $3.2bn (£2.5bn) Chinese-funded line signalled a new chapter in the country.
He warned that he would authorise the execution of vandals after four people were arrested damaging sections of a guardrail.
It is Kenya's biggest infrastructure project since independence.
The 470km (290 miles) line is part of China's Belt and Road initiative of massive global infrastructure projects.
The railway is supposed to eventually connect land-locked South Sudan, eastern Democratic Republic of Congo, Rwanda, Burundi and Ethiopia to the Indian Ocean.
Last week, Mr Kenyatta secured an additional $3.6bn from China to extend the railway line 250km (155 miles) west from the central town of Naivasha to Kisumu.
Mr Kenyatta, who is touting his development record as he seeks a second term in August's election, said the railway line heralded a new chapter in Kenya's history:
"A history that was first started 122 years ago when the British, who had colonised this nation, kicked off the train to nowhere... it was then dubbed the 'Lunatic Express'."
"Today... despite again a lot of criticism we now celebrate not the 'Lunatic Express' but the Madaraka [named after the day Kenya's attained internal self-rule) Express that would begin to reshape the story of Kenya for the next 100 years."
Railway deepens China's Africa links: By Judith Wambare, BBC Africa
The railway may be Kenya's biggest infrastructure project since independence but it is also a part of a strategic plan for China to deepen its economic links in Africa.
A concessionary loan from China will pay for 80% of the cost.
The loan has a 10-year grace period, within which the railway line is expected to have started to generate income. The repayments will then be spread over 30-40 years.
The Mombasa-Nairobi line is the first phase of a 840km (525 mile) line linking the port city of Mombasa to the western border town of Malaba.
The Chinese will be in charge of the new railway line for some time, while Kenyans are being trained to take over.
During the Belt and Road Forum for International Corporation meeting on 15 May, Mr Kenyatta asked China to ensure a win-win situation in its economic relationship with Kenya, as the country formally joined the infrastructure initiative.
The cost of the project has been criticised by opposition parties, who say it is too expensive and the economic returns exaggerated.
The government says that it needs to invest in infrastructure to attract foreign investment.
Kenya's new railway at a glance:
- Cost $3.2bn (£2.5bn)
- Funding for the 470km (290 miles) project was provided by China
- It took three-and-a-half years to build, using Chinese track-laying technology
- The line is supposed to eventually connect land-locked South Sudan, eastern Democratic Republic of Congo, Rwanda, Burundi and Ethiopia to the Indian Ocean
- Cuts the journey-time from Mombasa to Nairobi to four-and-a-half hours, compared to nine hours by bus or 12 hours on the previous railway
- An economy class ticket will cost 900 Kenyan shillings ($9; £7), slightly cheaper than a bus ticket. A business class ticket will be $30.
'Vandals to be hanged'
On Monday, police arrested three men for vandalising sections of the railway and are pursuing charges of economic sabotage.
Mr Kenyatta said such vandalism would not be tolerated:
"I acknowledge that the presidency gives me the right to pass laws... those found vandalising the infrastructure... I will pass a law for them to be hanged."