A federal judge has temporarily blocked an Indiana law that would have prevented doctors from providing gender transition care to minors. 

The law was set to take effect July 1 but on Friday, U.S. District Judge for the Southern District of Indiana James Patrick Hanlon issued a preliminary injunction in a lawsuit brought by four transgender youth, their parents, and a medical provider who said it violated the U.S. Constitution.  

“Today’s victory is a testament to the trans youth of Indiana, their families, and their allies, who never gave up the fight to protect access to gender-affirming care and who will continue to defend the right of all trans people to be their authentic selves, free from discrimination,” Ken Falk of the ACLU of Indiana, which represented the plaintiffs, said in a prepared statement.  

The Indianapolis Star, a member of the USA TODAY Network, has requested comment from Indiana Attorney General Todd Rokita’s office, which represents the state in court and is one of the defendants.

The ban targeted cross-sex hormone therapy, puberty-blocking drugs and gender reassignment surgery, according to Hanlon’s order. The judge specified that under the injunction the state can’t prohibit “gender transition procedures for minors except gender reassignment surgery and … speech that would aid or abet gender transition procedures for minors” while the lawsuit continues to move through the court.

The minors’ request that a judge freeze the ban on gender reassignment surgeries was denied, however, as Hanlon said they “lack standing to challenge that ban because gender reassignment surgeries are not provided to minors in Indiana.” 

Those who back the law say it would protect kids from making life-changing decisions at an age where they’re too young to understand the consequences. Opponents say the care targeted by the law is life-saving, and that the ban would end parents’ rights to make medical decisions on behalf of their children.