Nairobi, Kenya (CNN) Uhuru Kenyatta was sworn in for a second term as Kenya's President on Tuesday and pledged to work for national unity.

"I will devote my time and energy to build bridges, to unite and bring prosperity," Kenyatta told the huge crowd gathered for his inauguration at Nairobi's Kasarani stadium.

JUST WATCHED Odinga says he'll abide by the constitution Replay More Videos ... MUST WATCH Odinga says he'll abide by the constitution 00:38

The opposition, however, rejects his election outright.

The leadership contest has been rife with controversy amid allegations of vote tampering, an unprecedented high court ruling that nullified the initial vote and sporadic bouts of violence in opposition strongholds.

"The election that we just concluded was probably one of the longest ever held in our continent's history," Kenyatta told the crowd.

Read More