Fang Hong was jailed after posting poem about now-disgraced politician who came down ruthlessly on critics when in office

A Chinese blogger sentenced to a year in a labour camp said a court cleared his name on Friday in the first known instance of judges overturning a case linked to now-disgraced politician Bo Xilai.

Fang Hong said a court in the south-western city of Chongqing threw out his conviction for lack of evidence and ruled that the year he spent in the labour camp was an illegal detention.

The retired civil servant was arrested after posting a brief poem mocking Bo, who ruthlessly attacked critics and accused gang bosses in Chongqing before being dismissed as the city's Communist party chief and suspended from other posts in March. Fang was convicted and sentenced in April 2011. He said he would seek state compensation of about £3,800 and apologies from the city government and media outlets that put forward the accusations against him.

"I am very happy both personally and for the city of Chongqing," he said. "This is the start of a process of restoring the rule of law in the city."

A clerk reached by phone at the Chongqing third intermediate court confirmed that Fang's case had been heard and said a verdict would be announced through state media.

In an apparently related development, a former Chongqing district police chief, Wang Pengfei, and a former commander, Li Yang, were formally removed from their posts, the Chongqing Morning Post newspaper reported.

Both men had served under Bo's former police chief and right-hand man, Wang Lijun, who is now in custody after making a visit to a US consulate in the nearby city of Chengdu in January. Wang is thought to have told the Americans about Bo's transgressions and his concerns over the suspicious death last November of British businessman Neil Heywood, a longtime Bo family confidante.

As a member of the Communist party's politburo, Bo had been tipped as a likely candidate for one of the nine seats on its all-powerful standing committee when a new generation of leaders is named later this year. His downfall sent shockwaves through the party and Chinese society, prompting rumours of divisions within the leadership and even a possible coup attempt.

Overturning cases handed down during Bo's rule is a further attack on his legacy, and while many others are seeking redress, Fang is believed to be the first to have successfully done so.

Bo was reprimanded after Wang's consulate visit, sparked by a falling-out between the two men thought to be related to the investigation into Heywood's death. Formerly one of China's highest-profile politicians, Bo is currently under investigation by the ruling Communist party's disciplinary body, while his wife and an aide have been named as suspects in Heywood's murder.

Fang, who was released on 28 April, said his days in the labour camp were spent making Christmas ornaments for export to Europe.

Writing under the name Bamboo shoot Fang, the 51-year-old former Chongqing forestry officer was already known as a sharp-tongued critic of Bo's signature policies of fighting gangs and promoting the public singing of Mao Zedong-era propaganda songs.

But it was a two-line ditty about Bo and Wang posted to his microblog on 21 April last year – which quickly went viral – that brought the authorities' wrath down on him. Called to a police station for questioning, he was put before a police tribunal and sentenced for "fabricating facts and disturbing public order", according to a document issued by the Chongqing reform through labour committee.

Pu Zhiqiang, one of three high-powered Beijing lawyers advising Fang, said the case had inspired a new appeal to China's legislature to do away with the labour camp system that is supposed to punish petty criminals but is frequently used to silence political voices.

"We're hoping they will scratch a system that is unjust and illegal," Pu said.