Gay rights campaigners act out electric shock treatment to protest outside a court where the first court case in China involving so-called conversion therapy is held in Beijing. (Ng Han Guan/AP)

Gay rights activists in China sued a counseling center Thursday for its offers to cure homosexuality through “conversion therapy” — the first lawsuit of its kind in a country where gay people are granted few rights and little recognition.

Activists staged a protest outside a Beijing courthouse before the case was heard and said they hoped that the trial would persuade the medical community to change its policies on homosexuality and its practice of diagnosing it as a disorder.

Meanwhile, inside the courtroom, a 30-year-old man from southern China said he suffered trauma when a counseling center in the city of Chongqing tried to “cure” his homosexuality through electric-shock therapy and hypnosis. As part of his case, the man also sued, China’s largest search-engine company, for false advertising because it ranked the center’s Web site high in results generated for the search terms “homosexual” and “homosexual treatment.”

In an interview outside the courthouse, the man asked to be referred to as “Xiao Zhen” instead of using his real name for fear of discrimination among friends and relatives who don’t know he is gay. He said he has not told his parents about his lawsuit because he hopes to win the case and use it to soften their opposition to his being gay.

Offering gay-conversion therapy is not uncommon among counseling centers here. While such therapies are often promoted by conservative Christian groups in the West, in China the pressure often comes from gay people’s peers and especially parents, activists said.

Gay activists stage a small protest outside courtroom on Thursday where a gay man sued counselors for trying to "cure" him of homosexuality with electric shock treatments. (William Wan/The Washington Post)

Xiao said that after his parents found out last year that he is gay, they refused to accept it. And when they saw an advertisement for gay conversion therapy, they pressured him to seek help at the Chongqing Xinyupiaoxiang Counseling Center in February.

On its Web site, the center claims to have successfully cured 10 patients in 2011 and seven in the first six months of 2012. It charges $80 per counseling session and $4,860 for a full-course treatment.

Representatives of the center and an attorney for Baidu declined to discuss the case with reporters, leaving the courthouse quickly after the hearing.

The Chongqing center explains its views of homosexuality on its Web site: “Any type of homosexuality is not really homosexuality. It’s just a wrong way of sexual release. They just need to be guided.”

Xiao said a counselor at the center put him under hypnosis after laying him on a bed. The counselor told him to relax and imagine being intimate with another man. Then, he gave Xiao an electric shock.

The shock itself was not strong, Xiao said. “It was the fear of the shock that’s most unbearable,” he said. “I was told that they would repeat this process many, many times.”

Homosexuality was deemed a crime in China until 1997 and considered a mental disease until 2001, when it was removed from the Chinese Classification of Mental Disorders. But the manual still classifies homosexuality and bisexuality as a “sexual-orientation disorder,” which gay activists are lobbying to change.

The manual explains that although the behavior may not be abnormal, “some people might not want this or feel hesitant, and feel anxious, depressed and pain as a result. Some might seek treatment to change it.”

Although Chinese society has grown more accepting of homosexuality in recent years, conflicts remain because Chinese traditions put great emphasis on having children to continue the family bloodline. As a result, accounts abound of gay people keeping their sexual orientation a secret so that they can marry and have children.

China’s gay community, however, also has grown more vocal in recent years, activists say. They said they hope that the trial might further persuade society at large to change its attitude toward being gay.

Among the protesters and supporters outside the courthouse Thursday was Lin Xianzhi, 60, whose son came out to him four years ago at age 28.

For years, Lin said, he and his wife had urged their son to get married. When their son finally told them he is gay, “I felt the sky had fallen. We felt that everything we planned for him was destroyed,” said Lin, who worked as a civil servant in Jiangxi province.

“We had heard about the word ‘gay’ before but thought it existed only in foreign countries. Not here, and certainly not in our family,” he said.

Lin said he and his wife agonized over their son’s revelation for a long time. “We also considered whether this could be treated; after all, [China] has very advanced medical techniques now,” he said. But after reading more about the subject, they gradually began to come to terms with it and now do community outreach to spread awareness among others with children who are gay.

Correction: An earlier version of this article misidentified Lin Xianzhi as a woman. The article has been corrected.

Xu Yangjingjing contributed to this report.