Kenyan President Uhuru Kenyatta has been sworn in for a second and final five-year term, a month after winning a bitterly disputed election rerun marked by delays and boycott.

Several heads of states and tens of thousands of his supporters attended the inauguration at a stadium in the capital, Nairobi, on Tuesday.

Kenyatta, 55, won 98 percent of the votes cast in October's poll, which was boycotted by the main opposition leader, Raila Odinga, who alleged the poll would not be free and fair.

The election was marked by a low turnout with only 38 percent of the registered voters casting their ballot - 7.6 million of the 19.6 million registered voters.

Last month's poll rerun occurred after the country's supreme court annulled August's presidential election results citing "illegalities and irregularities" in the voting process.

Meanwhile, the opposition coalition attempted to gather for a "memorial rally" to honour the more than 50 people killed, mostly by security forces, in four months of political violence.

Police tried to break up the opposition's gathering and opened fire at the crowd, killing three people including a child.

Al Jazeera's Fahmida Miller, reporting from Nairobi, said police cordoned off the grounds where the opposition were planning to hold their rally.

"Police have been out in force to prevent people from gathering and have fired tear gas to disperse people trying to reach the grounds. The local government has said the planned opposition rally is illegal," Miller said.

Kenyatta's inauguration comes after the Supreme Court validated his victory in last month's rerun election.

Kenyatta is the son of the East African country's founding father.