Forty-seven pro-democracy campaigners in Hong Kong appeared in court on Monday after being charged with subversion for organizing and participating in an unofficial election last summer.

The activists were among more than 50 people arrested in early January for their roles in a July democratic primary that saw more than 600,000 people cast ballots to select candidates for the since-cancelled fall city elections.

The 39 men and eight women now on trial are accused of "conspiracy to commit subversion" under Hong Kong's national security law. If convicted, they face up to a lifetime in jail.

"We condemn the detention of and charges filed against pan-democratic candidates in Hong Kong's elections and call for their immediate release," US secretary of state Anthony Blinken said in a statement on Monday.

Those charged include the city's leading pro-democracy activists and lawmakers like student activist Joshua Wong, currently serving a 13 month prison sentence, as well as Civic Party leader Alvin Yeung Ngok-kiu and Democratic Party chair Wu Chi-wai.

More than 300 people appeared outside the West Kowloon court house on Monday morning to show support for the embattled activists and chanted popular pro-democracy slogans despite a strong police presence.

"The recent charges [...] mark an escalation in the application of the national security law," New Zealand foreign affairs minister Nanaia Mahuta tweeted.

Ninety-nine people have been arrested over suspected violations of the Beijing-backed law, which came into effect in June, according to officials.

"Constant suppression [will] never abate our faith," Jimmy Sham, Civil Human Rights Front convener, said on Sunday before being taken into police custody.

Sham was one of 54 democracy advocates arrested in a dawn raid on Jan. 6 in the largest national security law-related police operation to date. Seven people detained that day remain out on bail and did not appear in court on Monday, including American human rights lawyer John Clancey.