Cambodia’s opposition leader has been formally charged with treason for allegedly conspiring with the US to topple the government, and could face up to 30 years in prison if convicted.

Kem Sokha had been expected to lead his Cambodia National Rescue party in next year’s election in a strong challenge against the ruling Cambodian People’s party of the prime minister, Hun Sen, who has held power for three decades. Kem Sokha’s party has denied the treason allegation, saying the charge is politically motivated.

His arrest on Sunday in the middle of the night came amid a crackdown on the media. The few radio stations to carry voices critical of the government were shut down for alleged breaches of regulations, and the English-language Cambodia Daily, also independent of the government, was forced out of business after being presented with a huge but disputed tax bill.

Ly Sophana, a spokesman for the Phnom Penh municipal court, said on Tuesday that Kem Sokha was charged after a thorough investigation, including interrogation and examination of the evidence. The crime is punishable by 15 to 30 years in prison.

A statement issued by the court said he had secretly conspired with a foreign country to carry out an act harmful to the social order and that could cause unrest. It said he had been carrying out his plan since 1993 to topple the government step by step.

Speaking to 4,000 Cambodian garment factory workers on Sunday, Hun Sen claimed Kem Sokha had colluded with the US against his government and warned the opposition party it could be dissolved if it defended him. He provided no proof for his claim.

The government appeared to have based part of its claims against Kem Sokha on a video clip that shows the opposition leader giving a public speech in which he describes a grassroots political strategy to challenge Hun Sen with US support.

The clip, which was released by the government on Sunday, was published on YouTube in 2013 by the Australia-based Cambodia Broadcasting Network. In it, Kem Sokha says the US hired university professors and experts in America and Canada “to advise me on [a] strategy to change the leadership” in Cambodia.

A US State Department spokeswoman, Heather Nauert, did not address the allegations against Washington, but issued a statement expressing “grave concern” over Kem Sokha’s arrest, saying he “has a long, distinguished, and internationally recognised commitment to human rights and peaceful democracy”.

Nauert said the detention and “unprecedented” restrictions recently imposed on independent media and civil society “raise serious questions about the government’s ability to organise credible national elections in 2018”.

Legal threats forced Kem Sokha’s predecessor as leader, Sam Rainsy, to resign this year from the opposition party. He now lives in exile.