Former Kenyan Vice President Kalonzo Musyoka has said gunshots and a grenade were fired at his home in what he called “an assassination attempt” as a government shutdown of three major TV stations entered its second day.

Mr Musyoka told the Associated Press the attack occurred hours after his police security was withdrawn and he was blocked from attending a mock inauguration of opposition leader Raila Odinga on Tuesday in protest of President Uhuru Kenyatta’s new term after months of deadly election turmoil.

Police spokesperson Charles Owino confirmed that a stun grenade was hurled at Mr Musyoka’s home in the leafy Karen suburbs and two shots were fired from a rifle.

Mr ​Musyoka was to take the oath as Mr Odinga’s deputy president in the fake inauguration. “The motive was clearly political,” he said, describing the 1am blast as “shocking”.

He said after his police protection was withdrawn he felt vulnerable and hired a private security firm. “I knew we were vulnerable but I didn’t think they would strike that fast,” he said.

He said the private security firm vehicle parked in front of his gate may have dissuaded the attackers from trying to enter the house. No one was hurt.

On Tuesday, the government cut live transmission of the country’s top three TV channels as a huge crowd of tens of thousands gathered in a Nairobi park for the mock inauguration. Mr Kenyatta had “expressly threatened to shut down and revoke the licenses of any media house” that aired live broadcasts, the Kenya Editors Guild said in a statement.

It is not known how long Kenyatta’s government will maintain the shutdown of the three popular broadcast stations.

Mr Odinga, 73, took an oath holding a Bible over his head, amid cheers. The opposition leader called the ceremony a step towards establishing a functioning democracy in Kenya, East Africa’s economic hub.

“We are seeing the return of an authoritarian, imperial presidency in our country and rule by fiat, and this must be resisted,” he told the Kenya Television Network ahead of the ceremony. Afterwards, he updated his Twitter profile to call himself “President of the Republic of Kenya”.

Hours later, the government outlawed the opposition’s National Resistance Movement, with Interior Minister Fred Matiang’i declaring it an organised criminal group. Membership in such a group can lead to imprisonment of up to 10 years under Kenyan law.

The fake ceremony came after months of political uncertainty. Kenya’s Supreme Court nullified the August election after Mr Odinga claimed that hackers infiltrated the electoral commission’s computer system and changed results in favour of Mr Kenyatta.

The ruling was the first time a court had overturned a presidential election in Africa. The court cited irregularities and illegalities and said it ruled against Mr Kenyatta because the electoral commission refused to open its computer system for court scrutiny.

The court ordered a fresh election in October that Mr Kenyatta won and Mr Odinga boycotted, claiming a lack of electoral reforms.

Police clash with Raila Odinga supporters upon his return to Kenya Show all 6 1 /6 Police clash with Raila Odinga supporters upon his return to Kenya Police clash with Raila Odinga supporters upon his return to Kenya Raila Odinga is welcomed by his supporters REUTERS Police clash with Raila Odinga supporters upon his return to Kenya Policemen spray water to disperse supporters of Kenyan opposition leader Raila Odinga REUTERS Police clash with Raila Odinga supporters upon his return to Kenya Anti-riot police fire tear gas to disperse supporters REUTERS Police clash with Raila Odinga supporters upon his return to Kenya Supporters Raila Odinga throw stones at police REUTERS Police clash with Raila Odinga supporters upon his return to Kenya An injured protester receives assistance REUTERS Police clash with Raila Odinga supporters upon his return to Kenya A man lies dead after being shot during clashes with police and supporters of Raila Odinga REUTERS

Last week the opposition released what it called “authentic” election results showing Mr Odinga won the August vote, but it refused to say how it obtained the information from the electoral commission’s computer servers. The electoral commission called those results “fake”.

Police at first had vowed to block opposition supporters from attending Tuesday’s ceremony, leading to fears of violence.