Fourteen democracy activists in Hong Kong were convicted on Thursday on national security charges, adding to the ranks of dozens of others — once the vanguard of the city’s opposition — who may now become a generation of political prisoners.

The authorities had accused 47 pro-democracy figures, including Benny Tai, a former law professor, and Joshua Wong, a protest leader and founder of a student group, of conspiracy to commit subversion. Thirty-one of them had earlier pleaded guilty. On Thursday, judges picked by Hong Kong’s Beijing-backed leader convicted 14 of the remaining activists and acquitted two others. The charge carries a maximum penalty of life imprisonment.

The convictions show how the authorities have used the sweeping powers of a national security law imposed by Beijing to quash dissent across broad swathes of society. Most of the defendants had already spent at least the last three years in detention before the 118-day trial ended.

Some of those accused are former lawmakers who joined politics after Hong Kong was returned to Chinese rule by the British in 1997. Others are activists and legislators who have advocated self-determination for Hong Kong with more confrontational tactics. Several, like Mr. Wong, who rose to fame as a teenage activist, were among the students leading large street occupations in 2014 for the right to vote.

Their offense: holding a primary election to improve their chances in citywide polls.

“The message from the authorities is clear: Any opposition activism, even the moderate kind, will no longer be tolerated,” said Ho-fung Hung, an expert on Hong Kong politics at Johns Hopkins University.