Thousands of protesters marched through Hong Kong on Sunday in support of young activists who were sentenced to prison after a Hong Kong court overturned an earlier sentence for their roles in the massive demonstrations of 2014.

Student leaders Joshua Wong, Nathan Law and Alex Chow were sentenced to prison Thursday for their roles in huge pro-democracy protests nearly three years earlier, in the latest sign that tolerance for dissent is waning in the Chinese-ruled former British colony.

Protesters wearing prison uniforms and a mask shout slogans during the rally. The banner at right reads: 'Political prisoner is innocent.' (Vincent Yu/Associated Press)

The three were found guilty last year of leading or encouraging an illegal rally in September 2014 that kicked off the "Umbrella Movement" protests that captured world headlines.

Last Monday, the Eastern Court in Hong Kong stopped short of giving the trio jail time, citing the "political atmosphere" in the city. Both Wong and Law were ordered to do community service, while Chow was given a suspended three-week sentence. However, the Department of Justice applied for a review, seeking imprisonment.

The protests raised umbrellas during the rally, continuing a theme that began with demonstrations in the fall of 2014. (Vincent Yu/Associated Press)

On Thursday, the Court of Appeal announced jail terms for the activists ranging from six to eight months for unlawful assembly. The jail terms also disqualify them from running for the legislature for the next five years.

Separately, 13 other young activists were also jailed for trying to break into the Legislative Council building when protesting against a government's development plan in Hong Kong's Northeastern New Territories in June 2014.

On Sunday, thousands held umbrellas, signs and banners as they marched through Hong Kong streets, chanting against the sentencing.

One of the protest organizers, Tong Hiu-yan, said the government was trying to threaten Hong Kong's democracy by the court ruling, but that protesters would stay determined.

From the left, Nathan Law, 23, Joshua Wong, 19, and Alex Chow, 25, speak to reporters on Aug. 15, a day after sentencing that stopped short of seeing them serve time behind bars. That ruling was overturned on Thursday and Hong Kong's Court of Appeal sentenced all three to jail. (Anthony Wallace/AFP/Getty Images)

"We can see that the government is trying to hand out a very heavy sentencing to make us afraid in our future struggle for democracy and all other human right issues in Hong Kong," he said.

"So we feel really disappointed and we are gathering here for a protest. We want to show our determination and we believe that the government cannot put every one of us in jail if we continue to struggle," he said.

Former student leader Lester Shum, who helped organize Sunday's rally, said the number of protesters was the highest since pro-democracy protests in 2014 that paralyzed parts of the financial hub for 79 days.

The former British colony returned to China in 1997 under a "one country, two systems" agreement that ensured its freedoms, including a separate legal system. But Beijing has ultimate control, and some Hong Kong people are concerned it is increasingly interfering to head off dissent.