BEIJING — A gay Chinese man said Thursday he was suing a psychological clinic for carrying out electric shocks intended to turn him straight, as well as the search engine giant Baidu for advertising the center.

The Beijing LGBT Center, which campaigns for gay rights, said it was the first court case involving so-called conversion therapy in China.

China declassified homosexuality as a mental disorder in 2001.

The center’s executive director, Xin Ying, said some professional hospitals in China, as well as smaller private clinics, still provide conversion therapy and that the group hopes the case at the Haidian District People’s Court in Beijing will lead to a ban on the therapy.

Yang Teng, 30, told the Associated Press that the therapy given to him included hypnosis and electric shock and he was left physically and mentally hurt. He said he voluntarily underwent the therapy in February following pressure from his parents to get married and have a child.

“My hometown is a small city, people there still care about carrying on the family line,” Yang said, adding that now he can finally accept his homosexuality.

His lawyer, Li Duilong, said Yang was suing the Chongqing Xinyu Piaoxiang clinic for infringing his personal and health rights because they told him electric shock treatment was not dangerous but then harmed his health. He also said that Baidu bore joint liability because it carried its advertisement.

Li said part of their argument was that homosexuality was not a disease and should not be treated.

“According to the law, both sides should sign an agreement before electric shock or hypnosis is carried out, but (the clinic) did not offer,” said Li. “The staff told my client the electric shock felt like ‘being bit by a mosquito’ but it turned out not to be.”

A man at the clinic in southwest Chongqing city said he had no comment and hung up. Baidu said in an emailed statement that it doesn’t comment on cases that are in the legal process.

The lawyer said they were asking for compensation of more than 14,000 yuan ($2,300) to cover the cost of the therapy, the plane journey to Chongqing and lost earnings due to the trip. In addition, they are demanding an apology on the websites of both companies, he said.

Li said a judgment should be given within six months.

A man from the court’s duty office said he had no information about the case and referred calls to the general office where no one answered.

The Beijing LGBT Center organized a demonstration outside the court ahead of Thursday’s hearing, with a handful of people holding banners with slogans including “Homosexuality is not a disease, we don’t need to be cured.” Xin played a doctor who pretended to give another demonstrator lying on the sidewalk electric shock treatment.

Chinese society is increasingly accepting of gays and lesbians, although same-sex partnerships are not recognized and no laws outlaw discrimination against sexual minorities.