After the ruling, Mr Kenyatta said his government would "work with and serve all Kenyans without any discrimination whatsoever". "Above all, let us continue to pray for peace in our country," he said.
He served as deputy prime minister, minister for trade, and finance minister under outgoing President Mwai Kibaki. The 51 year old will be Kenya's youngest president.
Among the African leaders present for the inauguration are South Africa's Jacob Zuma, Nigeria's Goodluck Jonathan and Uganda's Yoweri Museveni.
CCEDU was among the officials ensuring the elections were free and fair.