A Chinese man won a court case, resulting in monetary compensation, after a court in Beijing ruled the electric shock therapy that was used to "cure" him of being gay.

The Independent reported the court ordered the clinic to pay Yang Teng, 30, a total of 3,500 yuan for costs incurred. The clinic was also ordered to apologize to Teng.

The landmark ruling in the conservative country was celebrated by gay rights campaigners.

The court ruled electric shocks were illegal and homosexuality was not something that required treatment.

Teng said he did not expect the court to side with him, but that the ruling has set a precedent and proven that homosexuality is not an illness.

"The court sided with me, and it has supported that homosexuality is not a mental disease that requires treatment," he told The Independent. "Someone needs to step up because we must stop such severe transgressions."

He hopes the ruling will stop parents from pressuring their children, similar to the experience he had which landed him in the clinic.

Teng said that his parents had forced him to marry and have a child, which is how he ended up at the clinic for treatment.

The ruling was a small victory, since the lawsuit had asked for quadruple the compensation in damages.

But attitudes are changing in the country.

Homosexuality is legal in the country, which has been the case since 1997, and was removed from a list of mental illnesses in 2001.

But it is still a problem for some, especially those who are concerned with the country's one-child-policy. The expectation, plus societal expectations, puts pressure on young people to marry and have children to continue the family line.

But on the other hand, the same society has also begun to accept homosexuality as has been proven by Shanghai's annual gay pride event.