AFTER undergoing hypnosis at a clinic in Chongqing, Peng Yanhui—who goes by the name Yanzi—was told to lie on a sofa, think about having sex with another man and move his finger if he felt any emotional or physical reaction. “Then, when my eyes were closed, the clinician suddenly turned on the electroshock machine,” he recalls. “I jumped up screaming loudly. When I said I was scared, he just smiled and said that was what he wanted.”

Yanzi (pictured in 2014 outside a court in Beijing at which he successfully sued the clinic) had good cause to be frightened. But he was not surprised. As a gay-rights activist, he had volunteered for the abusive “conversion” therapy to expose the prevalence of such treatments in China, which most doctors in developed countries consider to be unethical and medically fallacious. But many people who suffer similar ordeals do so under coercion. A new report by Human Rights Watch, an American NGO, gives details of 17 cases in 12 different provinces of people subjected to prolonged therapy involving medication or electric shocks, often under parental pressure. Most of the examples it cites occurred in public hospitals.

In 1997 China effectively stopped treating homosexuality as a crime and, in 2001, ceased defining it as a disorder. But, as in other countries, pseudoscientific attempts to “cure” gay people persist. In China, where there is a strong cultural belief in a patrilineal family system, it is mainly men who are subjected to such treatment. Most urban parents have only one child, partly as a result of once strict family-planning rules. If their only son is gay, they fear that the family line will be severed.

Some of those who endure the therapy attempt suicide, and some lie to their families about what the treatment has achieved, says Ying Xin, director of the Beijing LGBT Centre, an advocacy group for people who are lesbian, gay, bisexual or transgender. She says she does not know anyone for whom the treatment has worked. “It’s like any other kind of torture,” she says. “Some people eventually say whatever they are pressured to say.”

The court that heard Yanzi’s case did not rule that the treatment he was given was itself illegal—only that the clinician had lacked a licence and had engaged in false advertising by offering a cure for something that was not an illness. It ordered the clinic to publish the court’s verdict in medical journals, at the clinic’s expense. But Human Rights Watch believes that neither this case, nor the only other successful one like it, which was concluded in July, have had much deterrent effect. In both, the damages awarded were small.

Ms Xin of the LGBT centre says doctors must be taught to persuade families that there is nothing wrong with being gay. But that would mean driving away business. China’s public hospitals are money-grubbing. They would be loth to do that.