A day after President Trump announced a ban on transgender troops, China's LGBT movement scored a small but significant victory.

A Chinese court on Thursday found that a transgender man was unjustly fired from his job, a first-of-its-kind ruling that activists called a step forward in the fight for lesbian, gay, bisexual and transgender rights.

The litigant, who goes by “Mr. C” to protect the privacy of his family and girlfriend, sued his former employer, Ciming Checkup, a health services firm, alleging that he was fired for wearing men's clothes. He said his colleagues had told him he looked "like a lesbian" and might damage the company's reputation.

A court in the city of Guiyang ruled that Mr. C's employment rights were indeed violated. "The defendant terminated the contract with the plaintiff without a legitimate reason" and "infringed on the plaintiff’s equal employment rights," the ruling said.

It also said workers should not be discriminated against "based on their ethnicity, race, gender or religious beliefs." The court ordered his former employer to pay him the equivalent of $297.

Though the compensation is modest, the case matters — for two reasons.

First, activists believe that this is the first time a Chinese court has heard a case on transgender identity. Although there are a few trans figures in pop culture, public awareness of the issues facing trans people remains limited in China, so getting the issue on the record — and in the press — means a lot.

Second, the verdict clearly stated that workers should not face discrimination. Although the ruling was about worker rights — as opposed to, say, human rights — activists and lawyers believe it could shape employer behavior and encourage the government to develop an anti-discrimination employment law.

Mr. C's lawyer, Wang Yongmei, said she was pleased with the verdict. "Personally, I think that in terms of employment discrimination, this judicial precedent goes beyond [current] legislation," she said.

The ruling comes at an complex moment when Chinese civil and human rights lawyers are being harassed and jailed in large numbers, but the country's LGBT movement is making gains using the law.

Chinese law does not actually account for the possibility of discrimination based on gender or sexual identity. But in the last few years, lawyers and advocates have found creative ways to get cases tried in administrative or commercial courts, generating a considerable amount of coverage in the Chinese media.

In 2014, instance, a commercial court ordered a clinic to compensate a man who underwent electroshock therapy designed to “convert” homosexuals. Although the award itself was relatively small — about $550 — coverage of the case started a conversation about the notion that homosexuality could or should be cured.

The next year, a Chinese filmmaker, Fan Popo, filed suit against China’s powerful censorship organ, the State Administration of Press, Publication, Radio, Film and Television (SAPPRFT), demanding information about why his film, "Mama Rainbow," was pulled from the Web. Although the case centered on disclosure rules, not gay rights, he was able to call attention to the practice of blocking LGBT-themed content from Chinese television shows and films.

In 2016, a Chinese court heard the country's first same-sex marriage case. The case challenged a local civil affairs bureau to justify why two men could not register to marry. The court did not rule in their favor, but the case was covered extensively (and mostly favorably) in the Chinese press, putting the issue on the agenda.

At the same time, local authorities seem nervous about giving LGBTQ people space to express themselves. In May, police canceled an LGBT conference called Speak Out 2017 in the city of Xian and reportedly detained the organizers for eight hours. In June, regulators moved to ban LGBTQ content from video platforms.

That's why Mr. C vowed to press ahead with anti-discrimination work. "Although the case has ended, we still have a long way to go,” he said.

Mr. C, a transgender Chinese man who says he was fired for wearing men's clothes, stands outside a court in Guiyang, China, July 27, 2017, holding the court’s ruling that his dismissal violated his employment rights. (Courtesy of Mr. C.)

Shirley Feng and Yang Liu reported from Beijing.

Sign up for email updates from the "Confronting the Caliphate" series.