The Hong Kong Department of Justice said it welcomed the message that future violations may receive prison terms, and that little weight would be given to whether such acts were committed “in the exercise of constitutional rights or acts of civil disobedience.”

There was little celebration from the protest leaders.

“Our hearts are heavy,” Mr. Law said. “We walk free but Hong Kong’s democracy has lost a battle.”

Mr. Wong said he would “not describe today as a victory,” saying Hong Kong faces “rule by law instead of rule of law.”

“In the future, according to the handed-down judgment from the Court of Final Appeal, we may see more and more people locked up,” he said.

Last week, 12 members of the United States Congress nominated Mr. Wong, Mr. Chow and Mr. Law, along with the rest of the Umbrella Movement, for the Nobel Peace Prize, calling the case against the three “trumped-up.” Hong Kong and mainland Chinese officials accused the American politicians of interfering in domestic Chinese affairs.

Hong Kong lawyers and legal scholars have defended the courts. Last month, Chief Justice Ma warned against “a tendency to associate what may be the desired result in court proceedings with the integrity of the court system itself or with the integrity of the judge or judges involved.”

Mr. Wong and Mr. Chow were found guilty in 2016 of unlawful assembly, while Mr. Law was found guilty of inciting people to take part in the assembly. The charges stemmed from the storming of a fenced government square in 2014; that protest, and the police response, set off the Umbrella Movement demonstrations.