Chinese police have released on bail a woman who became an unwilling hero to tens of thousands of compatriots after stabbing to death an official who she said tried to rape her when she rejected his advances.

The state newspaper China Daily said authorities in Badong, Hubei, released Deng Yujiao last night because she had turned herself in after the killing more than two weeks ago.

But today many bloggers speculated that the decision reflected public pressure. Comments on the killing inundated blogs and bulletin boards, and news of the 21-year-old's release from custody was widely welcomed.

Deng's case – and its handling by police - has become emblematic of the struggle of ordinary people against abusive officials.

The message was spelled out in a protest at a Beijing university this week in which a gagged female student bound in sheets was shown with a message reading: "Anyone could become a Deng Yujiao."

Each twist in the investigation has aroused fresh sympathy for Deng, from the claim that the dead man hit her with a wad of cash when she refused to have sex with him to the allegation that police tried to label her mentally ill and that her mother was pressed to fire her lawyers.

Deng was working in a karaoke and leisure centre in Badong, central China, on 10 May when two officials demanded "special services" – a euphemism for sex – according to initial reports from the local authorities. After a brief struggle, she stabbed to death one of the men, Deng Guida, 44, the director of the area's business promotion office, and injured his colleague. According to Deng's account, obtained by the Southern Metropolis Daily, prostitution was common at the centre.

When she told the men she was not selling sex, Deng Guida responded: "Aren't you all the same? You are a prostitute but you still want to have a good reputation." Hitting her repeatedly with a wad of banknotes, he said: "Don't you want money? Would you believe if I am going to beat you to death with money today?"

Deng said she pulled out a knife after the men repeatedly dragged her back as she tried to leave. As Deng Guida pushed her on to a sofa, she lashed out with the blade. She called police to tell them Deng Guida was dying, and waited for them to arrive.

Police said they had found antidepressants in Deng's bag and initially had her committed to a mental hospital. A later police statement toned down allegations about the dead man's behaviour and claimed Deng had stabbed him with a fruit knife, rather than with a pedicure knife, which would have been readily available at the leisure centre. Her backers fear that is intended to imply that the act was in some way premeditated.

Supporters say any punishment she receives should be mild because she was acting in self-defence. They initially feared she could face murder charges, but think that is unlikely now she has been bailed.

"The change the police has made is fundamentally because of the supervision of the public opinion. I hope the police will keep walking towards the right direction and the netizens can make persistent efforts and carry out supervision to the end," wrote one blogger, Si Ning.

Another, calling himself Old Soldier, added: "This is the only good news since Deng Yujiao's case happened and I feel great relief. Why did the police change their attitude? It seems to be a response to the public and media's attention."

Officials in Badong have promised Deng a fair hearing. They refused to comment when contacted by the Guardian.