Supporters of gay marriage hold rainbow-colored flags as they rally in front of the Supreme Court in Washington March 27, 2013. REUTERS/Joshua Roberts

(Reuters) - The U.S. Supreme Court on Monday left intact California’s ban on “gay conversion” therapy aimed at turning youths under age 18 away from homosexuality, rejecting a Christian minister’s challenge to the law asserting it violates religious rights.

The justices, turning away a challenge to the 2012 law for the second time in three years, let stand a lower court’s ruling that it was constitutional and neither impinged upon free exercise of religion nor impacted the activities of clergy members.

The law prohibits state-licensed mental health counselors, including psychologists and social workers, from offering therapy to change sexual orientation in minors. The Supreme Court in 2014 refused to review the law after an appeals court rejected claims that the ban infringed on free speech rights under U.S. Constitution’s the First Amendment.

California outlawed gay conversion therapy in 2012, calling it ineffective and harmful. New Jersey, Illinois, Oregon, Vermont, New Mexico and the District of Columbia have similar laws on the books, according to the Human Rights Campaign, an advocacy group for lesbian, gay, bisexual and transgender people. The Supreme Court turned away a challenge to New Jersey’s law in 2015.

Gay conversion therapy methods range from counseling, hypnosis and dating-skill training to aversive techniques that induce pain or electric shocks in response to same-sex erotic images, according to California officials. Such treatments stem from a belief that homosexuality is a mental illness, a view that has been discredited for decades, the state said in court papers.

Lead plaintiff Donald Welch, an ordained minister and licensed family therapist, oversees counseling at Skyline Wesleyan Church, an evangelical Christian church in the San Diego area that believes sexuality belongs only in a marriage between a man and a woman.

Welch, along with a Catholic psychiatrist and a man who underwent conversion therapy and now aspires to perform it on others, sued the state claiming the law is unconstitutional.

After their free speech challenge failed, the plaintiffs’ pressed their claim that the ban violates their right to freely exercise their religion. Last October, the San Francisco-based 9th U.S. Circuit Court of Appeals rejected their arguments.