Tens of thousands have marched in China-ruled Hong Kong in an "anti-authoritarian rule" march that called for the resignation of the city's top legal official over the recent jailing of young democracy activists.

The march, an annual fixture over the past few years on China's October 1 National Day, comes at a time of nascent disillusionment with Hong Kong's once-vaunted judiciary.

"Without democracy, how can we have the rule of law," the crowds yelled as they marched through sporadic downpours, from a muddy pitch to the city's harbour-front government headquarters.

Organisers estimated about 40,000 people joined the march on Sunday.

Many protesters, some clad in black, expressed dismay with Hong Kong's Secretary of Justice Rimsky Yuen, who had over-ruled several other senior public prosecutors to seek jail terms for three prominent democrats: Joshua Wong, Nathan Law and Alex Chow.

"We believe he (Yuen) has been the key orchestrator in destroying Hong Kong's justice," said Avery Ng, one of the organisers of the rally that drew a coalition of about 50 civil and political groups.

Around one hundred Hong Kong activists are now facing possible jail terms for various acts of mostly democratic advocacy including the "Umbrella Revolution" in late 2014 that saw tens of thousands of people block major roads for 79 days in a push for universal suffrage.

While the October 1 march is a regular annual fixture, this was the first time the rule of law has been scrutinised like this, with the judiciary,- a legacy of the British Common Law system, long considered one of the best in Asia and a cornerstone of Hong Kong's economic success.

"It's like mainland (Chinese) laws have intruded into Hong Kong," said Alex Ha, a teacher of classical guitar, who was walking alone in the crowd.

Hong Kong, a former British colony, returned to Chinese rule in 1997 with the promise that Beijing would grant the city a high degree of autonomy and an independent judiciary under a so-called "one country, two systems" arrangement.

But over two decades of Chinese rule, differences have deepened between Communist Party leaders in Beijing and a younger generation of democracy advocates, some of whom are now calling for the financial hub to eventually split from China.