The infamous and often-overridden Ninth Circuit Court of Appeals has upheld state legislation making it illegal for pastors to counsel minors who are struggling with their sexuality and gender, according to Pacific Justice Institute.

The U.S. Court of Appeals for the Ninth Circuit in San Francisco on August 23 upheld California’s wildly controversial Senate Bill 1172 that bars licensed counselors — including pastors — from assisting youth who want to change or reduce their same-sex attractions. The law also prohibits any counseling that would steer youth away from gender confusion.

Pacific Justice Institute filed suit against SB 1172 in 2012 and initially won a preliminary injunction based on free speech. But eventually the Ninth Circuit created a new approach to free speech that the excludes counseling about sex, and deems it to be unprotected speech.

The case then went back to the Ninth Circuit on to consider religious freedom and privacy claims that had not been previously ruled upon by the Court.

Pacific Justice’s lead plaintiff is both a pastor and a Licensed Marriage and Family Therapist who oversees a counseling ministry in his church. Pacific Justice pointed out that the SB 1172 if applied would reaching over the walls of a church to prohibit what could be said during counseling by a pastor who is also a trained marriage and family therapist.

According to the law, “California has a compelling interest in protecting the physical and psychological well-being of minors, including lesbian, gay, bisexual, and transgender youth, and in protecting its minors against exposure to serious harms caused by sexual orientation change efforts … … Under no circumstances shall a mental health provider engage in sexual orientation change efforts with a patient under 18 years of age.”

But the Ninth Circuit today waved away concerns about California interfering with pastors’ religious practice, while also declining to address legal decisions that previously rejected state interference with church counseling.

Pacific Justice had also pointed out to the court, that dozens of transcript passages from SB 1172’s legislative record show the legislation is meant as a clear and direct attack against conservative religious viewpoints.

According to Pacific Justice attorney Kevin Snider, who argued the Ninth Circuit case, “The court today simply rewrote legislative history to avoid the uncomfortable reality that the California Legislature unabashedly targeted religious beliefs with this bill.”

Brad Dacus, president of Pacific Justice Institute, commented:

We are deeply disappointed by today’s ruling because it represents a giant step backwards for religious freedom. A government that can tell a pastor what he can and cannot say during counseling is a government that can tell a pastor what parts of the Bible are off-limits. The court also reminded us today that this law lays the groundwork for further restrictions on parental rights.

Pacific Justice is currently reviewing all its options with their clients, including a potential appeal to the Supreme Court.

Breitbart News has extensively covered the politics of the transgender ideology.