A federal appeals court on Thursday upheld California's law banning “ex-gay” therapy to minors.

A three-judge panel of the Ninth U.S. Circuit Court of Appeals unanimously upheld the state's right to prohibit so-called conversion therapy that attempts to turn gay teens straight.

“One could argue that children under the age of 18 are especially vulnerable with respect to sexual identity and that their parents' judgment may be clouded by this emotionally charged issue as well,” Judge Susan Graber wrote.

Christian conservative groups Liberty Counsel and the Pacific Justice Institute had filed the lawsuit to block the law from taking effect. Liberty Counsel said in an emailed statement that it would appeal the decision.

“The minors that Liberty Counsel represents do not want to act on same-sex attractions, nor do they want to engage in such behavior,” the group's head Mat Staver said. “They are greatly benefiting from this counseling. Their grades have gone up, their self-esteem has improved, and their relationships at home are much improved.”

“Legislators and judges in the state of California have essentially barged into the private therapy rooms of victimized young people and told them that their confusion, caused by the likes of a Jerry Sandusky abuser, is normal and they should pursue their unwanted and dangerous same-sex sexual attractions and behavior, regardless of whether those minors desire their religious beliefs to trump their unwanted attractions.”

In addition to the therapy's supposed benefits, backers argued that the law violated the free speech rights of counselors.

The court disagreed, saying that the law “merely prohibits licensed mental health providers from engaging in SOCE [sexual orientation change efforts] with minors” but does not “prevent licensed therapists from discussing the pros and cons of SOCE with their patients.”

“We further conclude that the First Amendment does not prevent a state from regulating treatment even when that treatment is performed through speech alone.”

Last week, New Jersey Governor Chris Christie, a Republican, signed into law a bill modeled after California's law. Other states, including Massachusetts and New York, are considering their own bans.

(Related: Chris Christie endorsing adultery by signing “ex-gay” therapy ban, conservative says.)