A prominent Chinese lawyer is expected to be freed after a Beijing court on Tuesday gave him a suspended prison sentence after finding him guilty in a case involving online comments critical of the ruling Communist Party.

The Beijing No. 2 Intermediate People’s Court found Pu Zhiqiang guilty of “provoking troubles” and “inciting ethnic hatred.”

Pu, 50, was sentenced to three years in prison but the suspended sentence means he does note have to serve prison time.

His lawyer, Shang Baojun, said Pu would be released Tuesday, and he could be placed under “residential surveillance” — a form of detention that is used to keep dissidents away from the public eye.

The guilty verdict disqualifies Pu from practicing law, and he must comply with certain restrictions and not commit crimes during the three-year period or risk being incarcerated.

Human rights group Amnesty International welcomed the suspended sentence but condemned the fact Pu was found guilty.

"Clearly it is positive that Pu Zhiqiang is unlikely to spend another night in jail, yet that cannot hide the gross injustice against him," said William Nee, a China researcher at Amnesty International in a written statement. "He is no criminal and this guilty verdict effectively shackles one of China's bravest champions of human rights from practicing law."

Pu had spent nearly 19 months in detention before his trial last week, which lasted just over three hours. His lawyers said he could have faced an eight-year sentence.

Shang said Pu would not appeal against the decision, and said Pu was relieved about the court's decision.

State news agency Xinhua said the court decided "to impose a lenientpunishment" due to "the fact that the defendant Pu Zhiqiang truthfully confessed to the facts of the crime and positively pleaded guilty."

Shang said Pu did not plead guilty.

Pu's supporters believe the case was politically driven to punish the outspoken lawyer who has become a leading figure among China's rights defense lawyers.

Pu was active in defending free speech and represented artist Ai Weiwei in a tax evasion case that Ai's supporters said was politically motivated. He also was instrumental in pushing for the eventual abolishment of the labor camp system, which allowed police to lock up people for up to four years without a trial.

Since coming to power in 2013, Chinese President Xi Jinping has spearheaded crackdowns on civil activists, rights lawyers and online freedom of expression, in moves aimed at snuffing out any potential threats to the Communist Party's grip on power.

Pu was detained shortly after attending a May 2014 meeting to discuss commemorating 25 years since the Tiananmen Square massacre, at a time when authorities were keeping a lid on any public commemorations of the event. Hundreds, possibly thousands, of protesters were killed in the crackdown, and the topic remains taboo in China.

After a prolonged investigation, Pu stood trial on Dec. 14 — more than 19 months after his detention — for several of his online comments that questioned Beijing's ethnic policies and poked fun at some political figures.

In one comment, Pu questioned why there were bloody incidents involving the Muslim minority of Uighurs when Beijing keep touting how great its ethnic policies are.

He also derided a veteran delegate to the national congress known for her six decades of never casting a dissenting vote.

On Tuesday, hundreds of police barred foreign journalists from approaching the court. About a dozen diplomats who showed up in an attempt to watch the verdict being delivered said they were turned away on the grounds the courtroom was full.

At least one supporter who rallied outside the court was hauled away by police.

Wire services