A federal appeals court on Thursday upheld a New Jersey law which bans ex-gay therapy to minors.

A 3-judge panel of the Third Circuit Court of Appeals in Philadelphia said it agreed with a lower court's ruling upholding the law.

Last year, New Jersey became the second state after California to prohibit so-called conversion therapy that attempts to turn gay teens straight.

Republican Governor Chris Christie said in signing the law that he does not believe being gay is a choice and that such therapies expose children to health risks.

Two groups which promote such therapies, the National Association for Research and Therapy of Homosexuality (NARTH) and the American Association of Christian Counselors, sued the state, arguing that the law infringes on parents rights to “direct the upbringing and education of their children according to their sincerely held religious beliefs.”

U.S. District Judge Freda L. Wolfson wrote in her ruling that the law does not violate free speech or religious freedom.

“To handcuff the State's ability to regulate a profession whenever speech is involved would therefore unduly undermine its authority to protect its citizens from harm,” the appeals court said in its ruling.