BEIJING — A Chinese court has ruled that a transgender man was unjustly dismissed by a former employer, the plaintiff said today, in the country’s first such discrimination lawsuit.

The 29-year-old man, who identifies himself only as “Mr. C” to protect his parents’ privacy, said the verdict by a district court in the southwestern city of Guiyang ruled his employment rights were violated. It ordered his previous employer, Ciming Checkup, to pay him the equivalent of $297.

“Short of a formal apology from Ciming, I think this lawsuit has achieved its purpose,” Mr. C told The Associated Press.

“It’s never been about money,” he said. “We hope, through this case, people in similar situations will realize they have a right, and we hope it will eventually result in a workplace anti-discrimination law.”

The court said no one was available to speak about the case. Ciming did not respond to AP’s requests for comment. Mr. C provided a copy of the verdict to the AP.

While still relatively conservative, Chinese society, especially the younger generation, has become more accepting of gays, lesbians, bisexuals and transgender people in recent years.

In 2001, the Chinese Psychiatric Association removed homosexuality from its list of mental disorders, although LGBT legal protections and concepts such as gay marriage remain foreign to most in positions of authority.

Still, the increased social acceptance has encouraged some members of sexual and gender minorities to come forward and demand their legal rights, with mixed results.

In 2014, a Beijing court ruled forced “conversion therapy” intended to change sexual preferences from gay to straight to be illegal. Earlier this year, a court in the central province of Henan ordered a public mental hospital to issue a public apology and pay $375 in compensation after forcing “conversion therapy” upon a gay man.

Yet, a court in the southern province of Hunan rejected an attempt by a gay couple to register their marriage in April 2016.

China has no law addressing employment discrimination and efforts are ongoing to enact laws protecting minorities in the workplace.

Mr. C filed the lawsuit after an arbitration council last year ruled against his claim that he had been unfairly fired by the medical testing center.

In a May 2016 interview with the AP, Mr. C said he decided to sue the company because he felt that someone had to do it when many people were unwilling or dare not to speak up about their employment rights.

The court ruled in December that he was improperly dismissed but found no evidence that he was discriminated against because he was transgender.

Mr. C pressed on and experts on labor and gender issues testified on his behalf.