The 9th U.S. Circuit Court of Appeals unanimously concluded that the ban, the first of its kind in the nation, did not violate the free speech rights of therapists and was within the state’s authority to outlaw medical or mental health practices it considers harmful to minors. The court also rejected the argument the law interferes with parents’ rights to seek such counseling for their children.

In two separate cases, a group of therapists and families sued over the ban, arguing that it violates the free speech rights of therapists to discuss gay conversion with young patients and tramples on parents’ religious freedom to seek therapy to convert their children from homosexuality. The law barred licensed mental health professionals from using the therapy on youths under the age of 18.

(The loopy and absurd technique also became infamous after the 2007 “South Park” episode “Cartman Sucks.” Butters Stotch’s parents thought he was “bi-curious” and sent to him a pray-the-gay-away camp, where several youth committed suicide after being told they were sexually confused. Out in the 562)

One federal judge had blocked enforcement of the law while the case is on appeal, while another refused to issue an injunction. The 9th Circuit has now lifted the injunction against the ban, although the therapists and families can ask the court to reconsider the case with an 11-judge panel.

The Pacific Justice Institute, one of the organizations challenging the ban, vowed to appeal.

“This decision is a dark day for those who believe in the First Amendment and the right of parents over the proper upbringing of their children,” said Brad Dacus, the institute’s president.

Opponents of the ban have expressed concern that other states would follow California if courts uphold the law. In fact, while the 9th Circuit was considering the case, New Jersey recently adopted a similar ban on gay conversion therapy, and that law has been challenged in federal court.

California legislators and gay rights advocates sought to abolish the therapy for minors, arguing that it stigmatizes youths and can lead to depression and even suicide. Gay rights groups praised the decision, as did some of the individuals who were forced to undergo the therapy and testified about its harmful effects.

“My first response at hearing (about the ruling) was chills and tears,” said James Guay, a pastor’s son who lived in San Francisco for 20 years until recently moving to West Hollywood. “This barbaric treatment has been deemed ineffective and likely harmful by all the legitimate medical and mental health associations.”