Prominent Hong Kong dissident Joshua Wong and two other leading activists pleaded guilty on Monday at the start of a trial over their involvement in last year’s protests, with the trio saying they were expecting jail terms.

Hong Kong was convulsed by seven straight months of huge and often violent democracy rallies last year in which millions took to the streets.

Beijing and local authorities have refused demands for free elections and have responded with a widening crackdown against democracy supporters.

Wong, 24, was prosecuted alongside fellow activists Ivan Lam and Agnes Chow over a protest which took place last summer outside the city police headquarters.

“We three have decided to plead guilty to all charges,” Wong told reporters before the trial began on Monday. “It will not be surprising if I am sent to immediate detention today.”

“We will continue to fight for freedom — and now is not the time for us to kowtow to Beijing and surrender,” he added.

“We have no regrets,” added Lam, 26.

Inside court Wong pleaded guilty to inciting and organising an illegal assembly. Lam pleaded guilty to incitement while Chow, 23, admitted inciting and joining the protest.

The charges carry up to five years in jail, although three years is the maximum a magistrate court can hand down.

Police became a target for demonstrators after tear gas and rubber bullets were routinely used to clear crowds when rallies kicked off last June.

The force’s headquarters was besieged on multiple occasions with crowds hurling eggs and daubing its walls with graffiti.

Chow had previously said she planned to plead guilty, a tactic which can lead to a lighter sentence.

Wong and Lam had originally vowed to fight the charges.

But Wong changed course, announcing his plan to plead guilty on Facebook late Sunday.

Despite his youth, Wong has already spent time in prison for leading democracy protests.

He became an activist when he was in his early teens, organising successful rallies in 2012 against plans to make Hong Kong’s education system more ‘patriotic’ and similar to the mainland.

Lam and Chow joined the same movement as teens.

In 2014 they helped inspire and lead the “Umbrella Movement” — a 79-day peaceful occupation of three busy intersections by a largely student-led campaign calling for universal suffrage.

Wong was jailed for his involvement in those protests, alongside most of that movement’s main leaders.

When last year’s much larger democracy protests kicked off, Wong was still in jail.

He vowed to continue fighting for democracy on his release and made appearances at numerous rallies throughout the year.

However the protests were deliberately leaderless, mostly organised by social media and encrypted chat forums.

They were also much more violent. Riot police unleashed thousands of rounds of tear gas and rubber bullets and were frequently filmed using batons to beat arrested demonstrators.

Small groups of hardline activists resorted to rocks, petrol bombs and even bows and arrows.

More than 10,000 people were arrested and Hong Kong’s courts are now filled with trials. Most of the city’s leading activists and opposition figures face prosecution.

The demonstrations petered out at the start of the year thanks to fatigue, mass arrests and the emergence of the coronavirus.

An anti-pandemic ban on more than four people gathering in public has remained in place for most of this year.

Beijing has also imposed a broad security law which ramps up its direct control over the semi-autonomous city and outlaws certain political views.

Demosisto, the pro-democracy party that Wong, Lam and Chow were in, disbanded when the security law came in because their policy of pushing for greater self-determination for Hong Kong was now illegal.

Opposition lawmakers have also been disqualified and local legislature elections delayed for a year.

Authorities say they have returned much needed stability to the global trade hub.

Critics counter that none of the underlying causes of the unrest have been addressed, and that opposition to Beijing’s rule remains widespread despite the lack of street protests.