A Chinese girl who stabbed a local official to death has been released free on Tuesday but judged guilty of excessive force.

Deng Yujiao, 21, a hotel waitress from Hubei province, killed a 44-year-old official Deng Guida with a fruit knife on May 10 during the rape attempt.

She was forced to prostitute, when three officials entertained themselves at a bathhouse. On feeling threatened with rape, Deng attacked the officials with a fruit knife, killing one and wounding another who tried to assault her. She then turned to the police for help, according to state-run media reports.

Police detained her for murder, but her story spread quickly on the internet and brought an outpouring of support and sympathy from people all over the mainland.

People accused the dead official for being immoral and police for unjust charge. As a result, the police released her under house arrest.

On Tuesday, a court in Badong County, Hubei province sentenced her for excessive use of force, but freed her because she acted out of self-defense and also because the girl suffers a certain level of mental disorder.

The charge aims to please both the authorities in judging the girl guilty and the general public who view Deng Yujiao as a hero.