LGBT people are still being subjected to forced confinement, medication and even electric shock therapy to “convert” them into heterosexuals.

Homosexuality is neither a crime nor officially regarded as an illness in China. For decades, the legal status of consensual same-sex activity between men was ambiguous, but that was cleared up in the revised criminal code of 1997.

In 2001, the Chinese Society of Psychiatry removed homosexuality from its list of mental disorders. This is consistent with the consensus of global medical associations that homosexuality is not a medical condition.

The “treatment” takes place in public, government-run hospitals and in private clinics, reports by Human Rights Watch released Wednesday.

The organisation interviewed 17 people who were threatened, coerced and sometimes physically forced by their parents to submit to conversion therapy, as adults or as adolescents. Five were subjected to electric shocks while being shown images or videos — or given verbal descriptions — of homosexual acts. One described it as like “having needles stabbing my skin.”

Eleven were forced to take medication orally or given injections, with medical staff ensuring they take the treatment “even when they resisted. Three tried to escape, and almost all were subjected to verbal harassment or insulting language by doctors and psychiatrists, including terms such as “sick,” “pervert,” “disease,” abnormal” and “dirty.”

One said the doctor had described homosexuality as promiscuous and licentious. “If you don’t change that about yourself, you will get sick and die from AIDS,” the doctor reportedly said. ‘You will never have a happy family. … Have you ever considered your parents’ happiness?”

Indeed, Chinese society strongly favours children who can pass on the family name. Gay children often face intense family pressure to enter heterosexual marriages and have children.

“It’s been more than 20 years since China decriminalized homosexuality, but LGBT people are still subjected to forced confinement, medication and even electric shocks to try to change their sexual orientation,” said Graeme Reid, LGBT rights director at Human Rights Watch.

Human Rights Watch said a 2013 mental health law effectively renders conversion therapy illegal, yet it still continues to take place.

Chinese courts have in recent months handed down two verdicts that were considered small steps forward for the LGBT community.

In July, a 38-year-old gay man in central China successfully sued a psychiatric hospital, after alleging that staff members detained, drugged and beat him in an attempt to “cure” him of his homosexuality.

The man surnamed Yu, won 5,000 yuan ($750) in compensation, with a court in Zhumadian, in Henan province, ordering the hospital to publish an apology in local newspapers.

The same month, a transgender man won a case against his former employer for unfair dismissal, alleging that he was fired for wearing men’s clothing. And in 2014, another gay man successfully sued a psychiatric hospital for administering electroshock treatment.

But gains are hard won in a country where LGBT activists still face suspicion, surveillance and sometimes harassment by the authorities. China also has no laws protecting people from discrimination based on sexual orientation and gender, a gap that Human Rights Watch could prevent victims of conversion therapy from seeking justice.

In May, Chinese authorities shut down a popular dating app for lesbians, while the following month, the government included homosexuality in banning “abnormal sexual lifestyles” from online video programs.

In Hong Kong, where civil groups are much stronger, the campaign to win the Gay Games was organised by volunteers rather than the territory’s government. Hong Kong Chief Executive Carrie Lam reportedly said she does not condone same-sex marriage, citing her Catholic faith.

But the island of Taiwan, in particular, has become a beacon for LGBT rights in the region. There, Tsai Ing-wen, the democratically elected president, welcomed a court ruling in May that a current law banning same-sex marriage is illegal, and she called on her government to begin drafting legislation to legalize it.