A federal judge temporarily blocked Georgia’s new law that bans certain treatments for transgender children while a lawsuit makes its way through the legal system.

In her ruling Sunday, U.S. District Judge Sarah E. Geraghty said that the law violates the 14th Amendment right of equal protection by discriminating against transgender minors. The law banned transgender minors from receiving hormone treatment.

“The desired outcome of the banned treatments — as no one disputes — is to begin a physical transition so that the adolescent patient’s development and appearance do not conform to those expected of the patient’s birth sex, but rather to the patient’s gender identity,” Geraghty wrote in her ruling. “In other words, (the law) therefore bans the use of cross-sex hormones only for those whose gender identity and natal sex (sex at birth) incongruent, and only for the purpose of achieving gender-nonconforming physical characteristics.”

Geraghty’s ruling allows the resumption of hormone therapy treatments for minors, which had been banned since July 1.

Several Georgia families filed a federal lawsuit against the state in June that had asked the courts to stop the measure from taking effect, saying it takes away the rights of parents to make health care decisions for their children. The complaint was filed a little more than a day before the law took effect July 1.

Supporters of the law say it protects children from taking steps toward gender transition that are permanent. Opponents say the law goes against published medical “standards of care” and will end up hurting transgender children, who commit suicide at a higher rate than their nontransgender peers.

Attorneys for the families — represented by civil rights organizations including the American Civil Liberties Union of Georgia, the Human Rights Campaign and the Southern Poverty Law Center — called Geraghty’s order an “incredible victory for Georgia families.”

“The ruling restores parents’ rights to make medical decisions that are in their child’s best interest, including hormone therapy for their transgender children when needed for them to thrive and be healthy,” the attorneys said in a press release.

Kara Richardson, a spokeswoman for Attorney General Chris Carr, said he was disappointed in the judge’s decision and plans to “immediately appeal to protect the health and well-being of Georgia’s children.”

Geraghty’s ruling comes after a two-day hearing earlier this month where attorneys representing the families of transgender children said that upholding Georgia’s law will have negative effects on the mental and physical health of transgender minors.

Receiving hormone therapy treatment, Geraghty wrote, improves mental health outcomes in various ways for minors diagnosed with gender dysphoria, such as reducing anxiety and depression and reducing suicidal thoughts and self-harm. Gender dysphoria — the distress that comes from feeling you’re not the gender you were assigned at birth — is a diagnosis often given to transgender people.

“A ban on hormone therapy would deprive patients of the possibility of these benefits,” Geraghty wrote. “It would, indeed, be likely to put some individuals at risk of the serious harms associated with gender dysphoria that gender-affirming care seeks to prevent.

“The court determines that the imminent risks of irreparable harm to plaintiffs flowing from the ban — including risks of depression, anxiety, disordered eating, self-harm and suicidal ideation — outweigh any harm the state will experience from the injunction,” Geraghty wrote in her order.

Attorneys representing the state argued that more studies should be done before claiming that the benefits of allowing minors to receive hormone or surgical treatment outweigh any potential medical risks, such as blood clots, heart disease or infertility.

When it was in effect, Georgia’s law, Senate Bill 140, banned health care professionals from giving hormones such as estrogen and testosterone to transgender minors. Doctors also were not allowed to perform surgeries on children seeking to align with their gender identity.

The ruling allows doctors to resume prescribing hormone therapy to transgender minors. The families did not challenge the ban on surgeries, something that minors rarely seek, so that prohibition remains in place.

Federal judges have stopped similar laws from taking effect in other states, including Alabama and Florida, as the cases make their way through the court process. The 6th U.S. Circuit of Appeals allowed similar laws to take effect in Kentucky and Tennessee after lower federal judges initially blocked them.