A federal appeals court on Friday struck down two local ordinances that prohibited therapies that attempt to alter the sexual orientation or gender identity of LGBT youth.

Such therapies go by names such as “conversion therapy,” “reparative therapy,” “sexual orientation change efforts” or “ex-gay therapy.”

A three-judge panel on the U.S. Eleventh Circuit Court of Appeals in Atlanta found that bans in the city of Boca Raton and Palm Beach County, Florida violate the First Amendment of the U.S. Constitution.

The 2-1 decision was written by U.S. Circuit Judge Britt Grant. Joining Grant in the majority was U.S. Circuit Judge Barbara Lagoa. Both judges were appointed to the bench by President Donald Trump.

“We understand and appreciate that the therapy is highly controversial,” Grant wrote. “But the First Amendment has no carveout for controversial speech. We hold that the challenged ordinances violate the First Amendment because they are content-based regulations of speech that cannot survive strict scrutiny.”

Major medical and psychological institutions have rejected conversion therapy as ineffectual and possibly harmful to youth.

The bans had been held up by a lower court.

In her dissenting opinion, U.S. Circuit Judge Beverly Martin, who was appointed by former President Barack Obama, said that she believes “the localities' narrow regulation of a harmful medical practice affecting vulnerable minors falls within the narrow band of permissibility [on restricting speech].”

The ruling impacts Alabama, Georgia and Florida, which fall under the court's jurisdiction. A large number of cities and municipalities in Florida have approved similar bans.

In a statement, LGBT legal group Lambda Legal called the ruling “incredibly dangerous.”

“So-called ‘conversion therapy’ is nothing less than child abuse,” Lambda Legal CEO Kevin Jennings said. “It poses documented and proven critical health risks, including depression, shame, decreased self-esteem, social withdrawal, substance abuse, self-harm and suicide. Youth are often subjected to these practices at the insistence of parents who don’t know or don’t believe that the efforts are harmful and doomed to fail: when these efforts predictably fail to produce the expected result, many LGBTQ children are kicked out of their homes.”

“The damage done by this misguided opinion is incalculable and puts young people in danger,” he added.

The Supreme Court in 2014 and again in 2017 refused to hear challenges to California's ban.