Connecticut has joined a growing list of states prohibiting 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” or “ex-gay therapy.”

Democratic Governor Daniel P. Malloy signed the bill into law on Wednesday, just hours after it unanimously passed the Senate. The measure took effect immediately.

“This legislation is about protecting children and teens who have been forced to undergo this so-called therapy,” Malloy said in a tweet.

Opponents of such laws argue that they trample religious freedom.

Democratic Senator Beth Bye told the AP that it is “a dangerous practice that relies on things like shame.”

Republican Senator Heather Somers said that such therapies are based on the “false assumption” that there is something wrong with people who are not heterosexual.

Four years ago, New Jersey became the second state after California to enact such a law. Illinois, Oregon, Vermont and the District of Columbia have passed similar bans, while New York Governor Andrew M. Cuomo last year issued an executive order that protects youth from such therapies. Several cities, including Tampa, Florida and Columbus, Ohio, have recently enacted similar measures.

(Related: New York Gov. Andrew Cuomo takes action to prevent “ex-gay” therapy on minors.)