Beijing (AFP) - A Beijing court Friday ordered a psychological clinic to pay compensation to a homosexual man for administering electric shocks in an attempt to make him heterosexual, an unprecedented ruling on so-called conversion therapy.

The plaintiff, a gay man named Yang Teng, said he felt traumatised when he received the shocks after being told to have sexual thoughts involving men.

Yang, who also uses the nickname Xiao Zhen, said the Xinyu Piaoxiang clinic was ordered to pay him 3,500 yuan ($562) and post a public apology on its website.

Yang said the court also ruled it wasn't necessary to administer the shocks since homosexuality did not require treatment.

"I'm going to take this verdict and show it to my parents so they can see a Chinese court said homosexuality isn't a mental illness," Yang told AFP.

The verdict, the first of its kind in China, was not posted on the court's website as of late Friday but photos of a document detailing the decision were shared on social media.

Calls to the clinic went unanswered Friday.

Those who come out to friends and family in China often face significant pressure to undergo sexuality "treatment" or marry a partner of the opposite sex.

Homosexuality stopped being classified as a mental disorder in China in 2001 but widespread intolerance toward gays and lesbians remains.

Activists had hailed Yang's unprecedented case as a significant step forward.

Those that campaign for gay rights in China still face harassment from authorities or bureaucratic roadblocks.

But LGBT groups in China are barred from registering as official non-governmental organisations (NGO), and activists often take a low-profile approach to promoting events lest the authorities decide to crack down.

Following his victory, Yang said he plans to continue working on LGBT rights so others like him can avoid similar treatment in the future.

Last May, a 19-year-old gay rights campaigner in the central province of Hunan was arrested for organising a 100-person protest that police described as "illegal".

Earlier this year, an advocate in the same province made headlines when he announced he was suing officials for denying his request to establish a gay-rights NGO.