Kenyan authorities shut down TV stations to prevent live coverage of a swearing-in event by opposition leader Raila Odinga, who boycotted last year’s disputed presidential election.
He declared himself the “people’s president” in front of thousands of his supporters in the capital, Nairobi.
The result of the August general election was annulled following allegations of irregularities.
Uhuru Kenyatta won a re-run in October, but Mr Odinga did not take part.
President Kenyatta was sworn in for a second term last November.
He warned the media not to cover Tuesday’s event and the attorney general said holding such a ceremony amounted to treason.
However, the main TV stations streamed the event on their websites and on YouTube and Facebook.
Holding a bible in his right hand at a park in Nairobi, Mr Odinga declared that he was answering to a “high[er] calling to assume the office of the people’s president of the Republic of Kenya”.
People had had enough of election rigging and the event was a step towards establishing a proper democracy in the East African state, Mr Odinga told a cheering crowd.
His deputy, Kalonzo Musyoka was not as the event. Mr Odinga said he would be sworn in at a later date.
Speaking earlier to Kenyan broadcaster KTN, Mr Odinga said the media ban “confirms we have descended to the level of Uganda”, which stopped media coverage during elections in 2016.
His “swearing-in” was intended to “show the world that what we are doing is legal, constitutional and not something you can remotely describe as a coup”, he added