The boxy red-and-white diesel train left from a gleaming new terminal in the port city of Mombasa.
The boxy red-and-white diesel train left from a gleaming new terminal in the port city of Mombasa, carrying Kenyatta, Chinese dignitaries and citizens from around the country on its maiden journey to Nairobi.
The five-hour journey will take less than half the time to drive between the two cities, a hair-raising trip on a one-lane highway clogged with lumbering trucks and where accidents claim dozens of lives each year.
"Today we celebrate one of the key cornerstones to Kenya's transformation to an industrialised, prosperous, middle-income country," Kenyatta said at the inauguration ceremony.
Dubbed the Madaraka (Freedom) Express, the train can carry 1,260 passengers and replaces the so-called "Lunatic Express" -- a railway built more than a century ago by colonial Britain which was known for lengthy delays and breakdowns.
The old railway, whose construction became the stuff of legend as a pair of man-eating lions devoured some 135 workers, is credited with shaping Kenya into its current form.
The capital Nairobi was a swampy outpost with no particular attraction until it became the headquarters of Kenya Railways.
Recalling the criticism the British government faced while building a "train to nowhere", Kenyatta compared it to the controversy the new railway has faced since construction began in December 2014.
Accusations of corruption, concerns over the impact on wildlife and criticism of the $3.2-billion (2.8-billion-euro) price tag blamed on poor negotiations with the Chinese, have dogged the project.
"Despite a lot of criticism, we now celebrate ... the Madaraka Express ... that will begin to re-shape the story of Kenya for the next 100 years," said Kenyatta.
The president is betting on the legacy project to help get him re-elected in August elections.
While the government has previously said economy class tickets would cost 900 shillings ($8.70/7.70 euros), Kenyatta on Wednesday announced that the price would be 700 shillings, prompting cheers from the crowd.
Shortly before the launch, four people were arrested for vandalising the new tracks and stealing "assorted railway parts", according to court documents.
Kenyatta blamed "economic sabotage" and threatened those responsible with the death penalty -- which has not been carried out since 1987.
"I pray for forgiveness from God, but I will sign their death sentence for them to be hanged," he warned.
Kenyatta on Tuesday flagged off the first cargo train, set to cut the cost and time involved in transporting goods to the capital.
The railway is part of a "master plan" by east African leaders to connect their nations by rail, with the Standard Gauge Railway (SGR) planned to eventually link Uganda, Rwanda, South Sudan, Burundi and Ethiopia.
This first leg of the railway is financed 90 percent by China's Export‑Import Bank, while the Kenyan government is providing the remaining 10 percent.
Transport Minister James Macharia said the government expects the railway to boost GDP by 1.5 percent, allowing them to pay back the loan "in about four years".
"I think that is a little bit of wishful thinking," said economist Kwame Owino, questioning assumptions about the volume of cargo available to be carried, while warning high growth rates in east Africa were beginning to moderate.
The railway will be managed by the Chinese contractor for five years before being handed over to the Kenyan government.
The next leg of the SGR will connect Nairobi with the Rift Valley town of Naivasha at a cost of $1.5 billion, and has caused a furore as it will cut through the capital's iconic national park.
The government is currently negotiating the financing to link Naivasha to Kisumu near the Ugandan border, which Macharia says is expected to cost another $3.5 billion.