Pro-democracy activists Joshua Wong, right, and Nathan Law, left, speak outside the high court in Hong Kong on Thursday. They were sentenced to six to eight months in prison. (Vincent Yu/Associated Press)

IN 2014, as Hong Kong erupted into protests calling for free elections, Joshua Wong emerged as the face of the city’s pro-democracy Umbrella Movement. Just 17 years old at the time, he led demonstrators as they marched on a fenced government square and organized weeks of sit-ins thereafter. In the years since, he has continued to champion democratic reform, establishing a student-led political party that won a seat on the legislative council. Apparently, this was more than Beijing and the pro-China local government could bear: On Thursday, Mr. Wong and two other activists, Alex Chow and Nathan Law, were sentenced to six to eight months in prison for their role in the peaceful protests.

Thursday’s ruling overturns lighter penalties handed down last year. Mr. Wong and Mr. Law were initially sentenced to community service, and Mr. Chow was given a suspended sentence. That the Hong Kong government pressed forward with prosecution was troubling enough, but its decision to appeal the original penalties and push for jail time is particularly vindictive. It is also politically self-serving: Hong Kong law prohibits people sentenced to more than three months in prison from running for office for five years. By cracking down on three rising political stars, the pro-Beijing establishment has managed to cripple its opposition and discourage further criticism.

The sentences send a chilling message that speech and assembly are only permitted in the city if they support the status quo. This strikes at many Hong Kong residents’ deepest fear: that the local government has become an extension of Beijing. When Hong Kong was officially transferred from British to Chinese rule in 1997, it was on the condition that China would allow the city a measure of autonomy and democracy. Hong Kong has long prided itself on its independent judiciary and system of self-rule. It is becoming increasingly clear, however, that the local leadership is willing to jettison these principles.

Over the past three years, Beijing and its loyalists in Hong Kong have restricted the field of candidates allowed to run for chief executive; reached across borders to detain five Hong Kong booksellers who stocked politically sensitive books; cracked down on street protesters calling for democracy; and stacked the deck to elect a pro-China leader, Carrie Lam, who trailed in public opinion polls. Most recently, Chinese lawmakers reinterpreted Hong Kong’s charter to disqualify four pro-democracy legislators for peacefully protesting during their swearing-in ceremony. Thursday’s decision should not be seen in isolation but as part of Hong Kong’s rapid descent into political repression.

What is especially sad about this crackdown is that it is so self-defeating: Both China and Hong Kong would benefit from a city that upholds the rule of law and promises a stable environment for investment. The more Hong Kong embraces authoritarianism, the less vibrant and prosperous it will be.