BEIJING — The device included a small square box connected to two long antennas, Yanhui Peng, a 34-year-old Chinese man, recalls. It was placed on a table near a couch in the center of the doctor's office in Chongqing, in western China.

"He told me to lie down and close my eyes," says Yanhui Peng, who goes by the nickname Yanzi, meaning "swallow" (as in the bird) in Chinese. "Then he hypnotized me. When I was slipping away, he told me to think about men's bodies and to move my fingers if that aroused sexual desire in me."

The next thing this slender man with an unflinching look remembered was the searing pain he felt in his arm. "He had electrocuted me with this device," he says angrily. Yanhui Peng jumped to his feet, horrified. The doctor was laughing.

"He told me homosexuality was a criminal offense and that it could cause diseases," the man recalls. "He promised me that if I accepted his treatment I could become heterosexual."

Yanhui Peng had paid 30,000 yuan (about $4,350) — a small fortune in China — for 30 sessions of "conversion therapy." Afterwards, he decided to sue the clinic. In 2014, a court in Beijing ruled in his favor.

In China, dozens of hospitals offer these kinds of treatments. "There are private clinics but also big public institutions like the Zhejiang University School of Medicine and a big center dedicated to mental illness in Guangzhou," says Yanhui Peng, who now works for an NGO to prosecute other providers of so-called conversion therapy.

Patients are subjected to electric shocks or cold showers and are given a cocktail of medication that includes antidepressants and nausea-inducing pills they have to take when watching gay pornographic movies. Some hospitals offer blood tests, DNA analyses and brain scans as well.

"If the results are normal, and they usually are, the doctor tells you that you can be cured because your homosexuality isn't genetic," the activist says.

Voluntary conversion

Some gay men are forced into treatment against their will. When one 36-year-old man from Henan province told his wife he wanted a divorce, she organized a kind of commando-style operation with the whole family. They tied the man's feet and hands and bundled him off to a psychiatric clinic, where he was imprisoned for 19 days. Forced to take medication and beaten on a regular basis, he finally managed to escape.

The Henan man's case is an exception. Most of the time, people who receive conversion therapy do so willingly.

Kuen-Ting [not his real name], a shy young man with a delicate face, pursued such treatment in Hong Kong a few years ago. "I was 22, studying at the university when I fell in love with a classmate," he says. "I come from a very religious family and many of my friends are Christians so I was really scared of their reaction."

Kuen-Ting, now 32, tried to hide his feelings but, in the end, opened up to the man he loved. "He told me about a therapy to cure my homosexuality," he recalls. The therapy was offered by New Creation, an evangelical organization founded by a psychiatrist, Hong Kwai-Wah, who developed a cognitive-behavioral treatment he describes as "post-gay." The approach assumes that sexuality is volatile.

"The idea that people are 'born this way' is not based on any scientific evidence," the psychiatrist says. "I have been working for 30 years and I have seen more than 100 homosexuals change their sexual orientation."

Hong Kwai-Wah thinks it's impossible to erase the feelings someone might have. But it is possible, he says, "to choose not to live like a gay person" — namely by not having sexual relations with a person of the same gender. He claims his success rate is 38%, including some who "abandon" their homosexuality entirely.

'Something dirty'

At New Creation, Kuen-Ting is told to treat the friend he fell in love with like a friend, to see him less often, to stop masturbating, and to pray instead. He was also urged to adopt more masculine activities. "I started playing basketball," he recalls.

But he didn't feel any improvement. Quite the opposite, in fact. "After one year I was depressed. My academic performance was bad and I suffered from anxiety attacks. I felt guilty because I thought I was the one to blame if I couldn't change, that I wasn't trying hard enough," he says.

New Creation eventually sent Kuen-Ting to Hong Kwai-Wah, who prescribed him an array of medication: antidepressants, tranquilizers and sleeping pills. But it didn't work — the pain was still there. "We cannot be forced to become someone we're not," says Kuen-Ting.

After a year and a half, he gave up and joined a gay church. He's now a social worker, helping other young people who face the same situation he experienced. He just ended a four-year relationship with a young man his mother accepted "as her own son."

How do we explain the barbaric "therapies" still inflicted on gay men? In China, homophobia is widespread — not so much for religious reasons as cultural ones. "Since the Cultural Revolution, sexuality has been considered to be something dirty, something that we don't talk about. Its one and only goal is reproduction,: notes Ying Xing, who runs the Beijing LGBT Center.

In this context, homosexuality is perceived as a form of deviance. "It wasn't decriminalized until 1997 and it was only removed from the list of mental illnesses in 2011," says Reggie Ho, president of the Pink Alliance NGO.

The government recently issued a directive that forbids television programs from showing "abnormal sexual relations" such as incest, rape, and yes, homosexuality. Chinese media tends to link homosexuality to AIDS or sexual addiction. It's also goes in the face of expectations about marriage and offspring.

"In China, if you come out, your parents will worry first off about the fact that you're not going to get married or give them grandchildren," says Tommy Chen, of the Rainbow Action NGO.

In a country where retirement pensions are nearly nonexistent, children are expected to take care of senior citizens — a trend aggravated by the one-child policy. The pressure is so strong that forums were created to help gay men and lesbians meet and get fake marriage contracts to ease parental pressure.

Yanhui Peng knows this double life all too well. "When I sued the clinic, I got on television. So I had to come out to my brother and my sister," he recalls. The siblings rejected him at first. His brother eventually got used to it but not his sister. "She told me homosexuality was a disease that you can catch. And so it can be cured," Yanhui Peng says.

See more from Culture / Society here