Nevada lawmakers have moved to ban so-called gay and trans panic defenses from being used to revictimize LGBTQ people who have been assaulted and/or murdered.

Senate Bill 97 prohibits use in a criminal case of certain defenses based on the sexual orientation or gender identity or expression of the victim.

The bill, introduced in January, passed the Nevada State Senate on the 16th on a vote of 19-2, with Republicans Ira Hansen and Pete Goicoechea voting against the bill.

A gay or trans panic defense is one in which the perpetrator of a crime states that they had a moment of impaired judgement after they faced an unwanted sexual advancement from someone of their same gender, or after discovering that someone they may have been sexually attracted to is transgender.

Related: Connecticut may ban ‘gay panic’ criminal defense

These defenses, in spite of a growing movement against them, remain legal in most states and are regularly used by defendants in anti LGBTQ assaults and murders.

Currently, only three other states have similar laws against such defenses on the books — California, Illinois, and Rhode Island — with several other states considering legislation similar to SB 97.

Perhaps the best-known case to use the gay panic defense is that of Matthew Shephard in Laramie, Wyoming. The defense team of Aaron McKinney, who along with Russell Henderson was convicted of the murder, had made claims that he had intended to rob Shephard, but killed the 21-year-old after Shephard made a pass at McKinney.

California banned the practice after the 2002 murder of transgender teenager Gwen Amber Rose Araujo, who was brutally beaten and murdered by a group of boys in Newark, California. The boys claimed they has instigated the attack after it was revealed that Araujo was transgender.

“It’s really targeting gay men and secondly transgender women. Year after year for the last four years we’ve had a record number of transgender women of color who have been murdered,” said the Williams Institute’s Brad Sears to the Nevada Current. “The value of this bill is for the state to take a stand against this epidemic of violence and to say the state protects LGBT people.”

The Williams Institute helped develop SB 97; the bill is also supported by a wide variety of LGBTQ and anti-violence advocacy groups