BEIJING — A Chinese court sentenced a prominent legal activist to four years in prison Sunday in a case widely seen as a demonstration of the Communist Party leadership’s determination to quell any challenges to its hold on power.

The activist, Xu Zhiyong, was convicted of “gathering a crowd to disturb public order,” a charge that stemmed from his role organizing a grass-roots New Citizens Movement, which sought to give voice to public discontent over official corruption and social injustice.

After a judge of the No. 1 Intermediate People’s Court in Beijing announced the guilty verdict and sentence, Mr. Xu denounced the trial as he was led away by guards, said one of Mr. Xu’s lawyers, Zhang Qingfang.

“He said, ‘The court today has completely destroyed what remained of respect for rule of law in China,’ and then he was taken away,” said Mr. Zhang. His account of the verdict and Mr. Xu’s comment was confirmed by the other defense lawyer, Yang Jinzhu.