President Uhuru Kenyatta vowed to unite the country after a bruising and drawn out election process that ended with his swearing-in. Picture: AP Photo/Sayyid Abdul Azim

Nairobi - President Uhuru Kenyatta on Tuesday vowed to be the leader of all Kenyans and work to unite the country after a bruising and drawn out election process that ended with his swearing-in.

"I will devote my time and energy to build bridges, to unite and bring prosperity," he said - a promise likely to ring hollow for the opposition, which rejects his election outright.

Kenyatta's calls for unity echo those he made throughout an election campaign in which he also launched searing attacks on the judiciary and opposition.

However the message is sorely needed in Kenya, as the more than four-month period of political upheaval has left the nation more divided than ever.

Read more: Kenyatta sworn in for second term as president

An election on August 8, won by Kenyatta, was annulled in a historic decision by the Supreme Court which ordered a re-run on October 26.

Kenyatta won that poll with 98 percent, as his rival Raila Odinga boycotted the vote, vowing it would not be free or fair.

"The election we have just concluded is probably one of the longest ever held in our continent's history," said Kenyatta, adding that his inauguration on the 123rd day since the country first went to vote marked "the end, and I repeat the end, of our electoral process".

"It has been a trying time but once again Kenyans have shown their resilience," he added.