HARTFORD, Conn. — Connecticut Gov. Dannel P. Malloy has signed legislation into law barring paid health care providers from engaging in so-called gay conversion therapy to change a minor’s sexual orientation or gender identity.

The Democrat signed the bill during a hastily called ceremony in his office Wednesday, minutes after it unanimously cleared the Senate. It took effect immediately.

Malloy says he’s happy to see Connecticut leading on the issue.

West Hartford Sen. Beth Bye, a Democrat, says conversion therapy has occurred in Connecticut and it is “a dangerous practice that relies on things like shame.” She says it’s particularly concerning with young people who are at risk for suicide.

Groton Sen. Heather Somers, a Republican, says the practice is based on the “false assumption” there’s something wrong with people who aren’t heterosexual.