NASHVILLE, Tenn. (AP) — Three transgender children and their parents sued Tennessee on Thursday over a new law that bans gender-affirming care for minors.

The law, scheduled to go into effect on July 1, prohibits health care providers from providing hormone treatments or surgeries for transgender youth where the purpose is to allow the child to express a gender identity “inconsistent with the immutable characteristics of the reproductive system that define the minor as male or female.”

The lawsuit was filed by the American Civil Liberties Union of Tennessee and other groups in federal court in Nashville. It claims the Tennessee law violates the 14th Amendment’s equal protection clause because it allows the banned medical treatments when they are used to treat conditions other than gender dysphoria. It claims the ban is based on “generalized fears, negative attitudes, stereotypes, and moral disapproval of transgender people,” rather than the well-being of the state’s adolescents and children.

“All of the treatments prohibited by the Health Care Ban are permitted when undertaken for any reason other than to affirm a gender identity that differs from a patient’s sex designated at birth,” the lawsuit reads.

The lawsuit also claims the ban violates parental autonomy protected under the due process clause of the 14th Amendment.

One of the plaintiffs is a 15-year-old transgender girl who sued under the initials L.W. Growing up, L.W. had constant anxiety about her gender, the lawsuit states. Her discomfort with using the boys’ restroom at school was so great that she would avoid it altogether and develop urinary tract infections.

After she told her parents that she was transgender, L.W. began taking hormone blockers and later estrogen. Her parents say they have noticed a huge change in L.W., who is now “outgoing and thriving,” according to the lawsuit. The parents say the new law will force them to either leave Tennessee entirely or makes costly trips out of state for L.W.’s medical care.

The law includes a nine-month phase out period for medical treatments begun before it goes into effect, but no new treatments could be started during that time and all treatment must be completed by March 31, 2024. Health care providers who violate the ban would be subject to regulatory discipline and could be sued by the attorney general or private parties. Violations carry a $25,000 penalty.

The Tennessee Attorney General’s Office did not immediately return a message requesting comment on Thursday.

At least 12 other states have enacted laws restricting or banning gender-affirming care for minors. Federal judges have blocked enforcement of the laws in Alabama and Arkansas.