Kenya's High Court has ordered the government to end its shutdown of the country's top three TV stations after they tried to broadcast images of the opposition leader's mock inauguration, a ceremony considered treasonous.

Journalists and human rights groups have raised an outcry over the shutdown of live transmissions that began Tuesday. Some journalists have told the Associated Press they spent the night in their newsroom to avoid arrest.

Opposition leader Raila Odinga on Tuesday declared himself “the people's president” in protest of President Uhuru Kenyatta's election win last year, in a ceremony attended by tens of thousands of supporters in the capital, Nairobi. Odinga claims the vote was rigged and that electoral reforms in the East African nation have not been made.

The government responded to Odinga's “swearing-in” by declaring the opposition movement a criminal organization and investigating “conspirators” in Tuesday's ceremony. An opposition lawmaker who stood beside Odinga and wore judicial dress during the ceremony has been arrested, his lawyer said.

Kenya's interior minister, Fred Matiangi, on Wednesday said the TV stations and some radio stations will remain shut down while being investigated for their alleged role in what he called an attempt to “subvert and overthrow” Kenyatta's government. Matiangi claimed that the media's complicity in the mock inauguration would have led to the deaths of thousands of Kenyans.

But on Thursday, High Court Judge Chacha Mwita directed the government to restore the transmission for the Kenya Television Network, Citizen Television and Nation Television News and not to interfere with the stations until a case challenging their shutdown is heard.

Kenya's freedoms are “under serious attack right now,” Odinga told reporters, calling the country's ruling party “certainly mad.”

Henry Maina, regional director of media rights group Article 19, had called the shutdown of TV stations a violation of constitutionally guaranteed media freedoms and the “lowest moment for media freedom in a decade.” The New York-based Committee to Protect Journalists had called on Kenyan authorities to allow the TV stations to immediately resume broadcasting.

A popular TV news anchor said Thursday that he and two other journalists were forced to spend the night in their newsroom to avoid arrest.

Larry Madowo, a news anchor with Nation Television, said multiple sources informed him and colleagues that undercover policemen were waiting in the parking lot outside their offices. He said the journalists decided to spend the night in the newsroom for security reasons.

The 73-year-old Odinga called Tuesday's ceremony a step towards establishing a functioning democracy in Kenya, East Africa's economic hub, after months of political uncertainty.

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

Kenya's Supreme Court nullified the August election after Odinga claimed that hackers infiltrated the electoral commission's computer system and changed results in favor of Kenyatta. The ruling, citing irregularities and illegalities, was the first time a court had overturned a presidential election in Africa. The court ordered a fresh election in October that Kenyatta won and Odinga boycotted, claiming a lack of electoral reforms.

After Tuesday's ceremony, Odinga updated his Twitter profile to call himself “President of the Republic of Kenya.”