The ruling does not mean immediate legal change in any of the countries, and none of them have so far changed their laws. The court does not possess a strong enforcement mechanism that can make lawmakers pass new legislation, and activists cautioned that it may take several more court cases before legal change comes to individual countries.

But nevertheless, many greeted the ruling as an important milestone.

“The European Court of Human Rights is very much respected in Europe and we can expect that in the majority of countries where this issue comes up, this ruling will be respected as the new precedent,” said Richard Köhler, the senior policy officer at Transgender Europe. He said the first impacts of the decision may be seen in upcoming court cases in Bulgaria and Macedonia.

Sterilization procedures take many forms in the countries where it remains a requirement, said Kyle Knight, a researcher in the lesbian, gay, bisexual and transgender rights division at Human Rights Watch. He said some countries mandate the surgical removal of genitalia and reproductive organs while other requirements more vaguely call for procedures that produce “irreversible infertility.”

“All of these are coercive, humiliating, and unnecessary,” he said.

While activists celebrated the ruling, many also said it did not go far enough. Transgender people in many European countries are required to receive a mental health diagnosis or undergo medical examinations before they can legally change their gender, and the court did not find those requirements to be a violation of human rights.

“The court followed its previous arguments that trans issues are medical issues and decided it was in line with European standard of human rights to request a medical exam and a mental health diagnosis,” said Mr. Köhler. “We think the next frontier is to get trans people and trans issues outside the medical framework because no gender identity is pathological or can be determined by someone else except for the person concerned.”

Governments in Western Europe have begun moving away from requiring transgender people to undergo sterilization or gender reassignment surgery in recent years. Mandatory gender reassignment was found to be unlawful in Austria in 2009 and in Germany in 2011. Sterilization requirements were outlawed in Sweden in 2012 and in Norway in 2014.

Only a handful of European countries allow transgender people to legally change their gender without the input of medical or mental health professionals, Mr. Köhler said: Ireland, Denmark, Norway and Malta, which also bans conversion therapy, a collection of pseudo-psychiatric methods that attempt to change a person’s sexual orientation or gender identity.

In the United States, requirements for legally changing one’s name and gender on official documents vary from state to state, said Arli Christian, a state policy counsel at the National Center for Transgender Equality. No proof of gender reassignment surgery is needed to change federally issued documents like a passport, but 23 states require proof of surgery before they allow someone to change state-issued documents like a birth certificate.