A Chinese karaoke bar waitress who became a folk hero after fatally stabbing a Communist party official when he demanded sex was freed today by a court that ruled she acted in self-defence, state media reported.

The Badong County people's court exempted Deng Yujiao, 21, from punishment for the crime of intentional injury because she was acting in self-defence, the official People's Daily newspaper said on its website.

The report said the court ruled that Deng had limited criminal responsibility and also took into account that she turned herself in to police after using a fruit knife to stab 43-year-old Deng Guida, who later died.

Coverage of her case in the state-controlled media has been unusually sympathetic.

Popular posts in online forums called Deng "the best girl on the planet", composed lines of verse in classical Chinese that described her as "beautiful and fierce" and dedicated the lyrics of a popular love song, Like a Mouse Loves Rice, to her.

Her popularity reflects widespread anger in China over the abuse of power by Communist cadres, officials and the security forces. A similar public outpouring of sympathy followed the case of a man who confessed to killing six Shanghai police officers last year in revenge for torture he allegedly suffered while being interrogated about a possibly stolen bike.

Chinese media reported that Deng Guida found the waitress in the laundry room of a hotel spa, a few floors below the bar where she worked, and demanded sex.

When she refused, he allegedly forced her down on a couch and blocked her from leaving. She attacked him with a fruit knife she had in her bag, the report said.

Police said she also attacked his colleague, Huang Dezhi, at the hotel in Badong, in the central province of Hubei.

The Xinhua news agency reported last month that Huang and another government official who was at the spa on the night of the stabbing were fired amid investigations, while police shut the spa and were questioning its owners. Huang has also been detained, the report said.