BEIJING — Veteran Chinese labor activist Liu Xiaoming has been sentenced to 4 ½ years in prison on the charge of inciting subversion of state power after he published his personal account of the bloody 1989 crackdown on pro-democracy protesters, rights groups reported Friday.

Liu was sentenced by a court in the southern city of Guangzhou after having already spent more than two years in detention, Amnesty International said. He was taken into custody in May 2015, five days after publishing his account of the events of 1989 on an overseas website.

A Guangzhou court docket listed a sentencing hearing on the subversion charge scheduled for Friday but gave no name or other details. Calls to the court rang unanswered.

The same charge was leveled against Nobel Peace Prize laureate Liu Xiaobo, who was sentenced to 11 years in prison in 2009 and is now suffering from late-stage liver cancer.

Liu Xiaoming’s sentencing illustrates China’s determination to pursue a relentless crackdown on lawyers, rights activists and workers’ advocates outside the direct control of the ruling Communist Party.

Liu had been a worker at a steel mill when he travelled to Beijing to join the mass demonstrations centered on Tiananmen Square. He became a member of an independent labor federation that sprang up as part of the pro-democracy movement. He was jailed for a year following the army crackdown, in which hundreds, possibly thousands were killed.

In recent years, Liu had worked on behalf of migrant workers in the industrial heartland of which Guangzhou is the center. At his trial in April 2016, prosecutors claimed he had “engaged in rumor mongering and slander against state power and socialism” by posting writings on social media sites such as WeChat, QQ groups and Telegram, according to the group China Human Rights Defenders.

“The Chinese government needs to stop throwing in jail those who are only trying to peacefully remember the 1989 Tiananmen crackdown and instead take responsibility for the authorities’ past wrongs,” William Nee, Amnesty International China researcher, said in a statement.