<strong>Tokyo, Japan. </strong>Tokyo's Rainbow Pride Parade marched through Shibuya and Harajuku on the final day of the May 2018 celebrations.
Tokyo CNN  — 

Japan’s top court has ruled that a government requirement for transgender people to be sterilized before they could be legally recognized was unconstitutional, in a victory for the country’s LGBTQ community years in the making.

Under a law enacted 20 years ago, transgender individuals who want their identity documents amended must have been diagnosed with “gender identity disorder,” be at least 18 years old, be unmarried and without any underage children.

They must also have genital organs resembling those of the opposite sex, and have no reproductive capacity. That means they must have undergone invasive procedures including sterilization and plastic surgery.

The law has long been decried by rights groups, and previous challenges in court have been struck down – until this case, brought by a transgender woman who wanted to change her legal gender from male to female without surgery.

The plaintiff argued that years of hormone therapy had already impacted her reproductive capabilities, according to public broadcaster NHK.

Her case had been rejected by a family court and a higher court before arriving at the Supreme Court. On Monday, the court ruled in her favor, declaring that the provision requiring sterilization was “in violation” of the constitution.

“The restriction of freedom from bodily harm under this provision has become increasingly unnecessary at this point in time and the degree of the restriction has become more serious. Therefore, the provision in question is not necessary and reasonable,” the court said in its ruling.

It added that reproductive rights are “considered to be fundamental human rights” under the constitution. “The fact that they must unwillingly undergo removal of their reproductive capacity in order to match their self-identified sex with their legal sex is a cruel choice,” the judgment said.

The historic decision is only the 12th time since World War II that the Supreme Court has judged a legal provision as unconstitutional, thus forcing Japan’s parliament to review the law, NHK reported.

However, that doesn’t mean the whole law is being changed – only the provision requiring sterilization.

The Supreme Court declined to rule on the other provision requiring transgender individuals to have genital organs “resembling” the opposite sex, saying it was constitutional. That part of the case will be sent back to a lower court to deliberate, according to Monday’s ruling, which added that the requirement does not “directly compel” transgender individuals to undergo surgery.

The ruling was met with mixed reactions – some praise and celebration within the LGBTQ community, but also concern about the remaining surgical requirements, and about broader societal attitudes.

At a press conference after the ruling, the plaintiff’s lawyer Kazuyuki Minami read a statement from the plaintiff, saying she was “extremely surprised at the unexpected outcome.”

“It is very regrettable that (my) gender change was not approved by the Grand Chamber of Justice and that the case has been postponed,” she said in the statement – but added, “I am glad that the outcome of this case will lead to a positive direction.”

The attorney, Minami, added that there are “really very few” judgments that deem existing laws unconstitutional, making this ruling “very significant.” However, he acknowledged, “it is frustrating that we haven’t reached the best conclusion that (the plaintiff) wants.”

Ken Suzuki, a law professor specializing in LGBTQ issues at Japan’s Meijin University, described the court’s decision as “half a ruling,” saying members of the community are still waiting for the lower court to decide whether other surgeries will be required to have genitals “resembling” the other sex.

“Nonetheless, it gives them hope,” he said, calling it a “revolutionary judgment.” “Many can see how the judges actually have taken a great interest in the topic.”

The National Coalition for the Establishment of Laws for Persons with Difficulties Due to Sexual Orientation and Gender Identity, also known as the LGBT Law Coalition, also applauded the decision – while saying it hoped the Supreme Court would make a “fair decision” on the remaining requirements for transgender individuals.

The organization also expressed “strong regret” over recent discriminatory incidents against transgender individuals, including widespread “anxiety and fear” over transgender individuals using their bathrooms of choice.

Earlier this summer, the Supreme Court ruled against a government agency that had barred a transgender employee from using the women’s bathroom – its first ruling involving the rights of sexual minorities in the workplace, according to NHK.

Much of Japan has long held conservative views toward LGBTQ issues – and while polls in recent years have suggested attitudes are shifting, activists say discrimination is still rife. For instance, Japan is the only Group of Seven (G7) nation with no legal protection for same-sex unions.

This spring the government came under increasing pressure to pass a law promoting understanding of the LGBTQ community, ahead of hosting the G7 leaders’ summit in May – but wrangling over the bill meant it was only submitted to parliament the day before the summit began.

In the end, the bill that passed was a watered-down version of what activists had hoped for, with no human rights guarantees provided – and even wording that may tacitly encourage some forms of discrimination, critics say.

CNN’s Chris Lau contributed to this report.