New York Governor Andrew Cuomo, a Democrat, on Sunday signed a bill into law that bans use of the “gay or trans” panic defense in criminal cases, making New York the eighth state with such a law.

“The gay and trans panic defense is essentially a codification of homophobia and transphobia, and it is repugnant to our values of equality and inclusion,” Cuomo said in a statement. “This defense strategy isn’t just offensive – it also sends a dangerous message that violence toward LGBTQ people is somehow OK. It’s not, and today we’re sending this noxious legal tool to the dustbin of history where it belongs.”

Criminal defendants who use the controversial defense claim that a violent act was triggered by the revelation of a victim's actual or perceived sexual orientation or gender identity.

States with similar laws include California, Hawaii, Connecticut, Maine, Illinois, Nevada, and Rhode Island.

(Related: Hawaii adds nonbinary gender option on driver's licenses; bans “gay panic” defense.)

The legislation was sponsored by state Senator Brad Hoylman, a Democrat from Chelsea, and Assemblymember Daniel O'Donnell, a Democrat from Manhattan. Both lawmakers are openly gay and married.

“By banning the so-called gay and trans panic defense, New York is sending a message to prosecutors, defense attorneys, juries and judges that a victim’s LGBTQ identity shouldn’t be weaponized against them,” said Hoylman, who attended Sunday's signing ceremony.