A bill prohibiting the use of a victim’s sexual orientation or gender identity as a defense for a violent crime committed against them passed the Nevada State Senate Tuesday.

Only two Republican senators, Pete Goicoechea and Ira Hansen, opposed the bill, which passed with overwhelming support on a vote of 19-2.

The legislation now moves to the state Assembly where Democrats outnumber Republicans 29-13, if passed Nevada could become the fourth state in the country to ban the use of the so-called “gay panic” or “trans panic” defense.

It is one of several bills to make it out of committee last week that are being approved by the Senate this week.

The bill, SB 97, was sponsored by the Senate Committee on Judiciary on behalf of the Nevada Youth Legislature and would ban the “gay panic” or “trans panic” defense, which attempts to reduce sentences for alleged criminals by arguing that their violent actions were provoked or justified because their knowledge of the victim’s sexual orientation or gender identity created reasonable fear for their safety or well-being.

While uncommon, such defenses have been used in several high-profile hate crimes of murders of members of the LGBTQ community. One study shows it has surfaced in about half of all U.S. states and has been used with some success.

In a March Senate committee hearing for the bill, supporters called the defense “pseudo-science” that reinforces and institutionalized prejudice against the LGBT community resulting in baseless sentencing reductions or even acquittals while undermining the legitimacy of criminal prosecutions.

The bill was largely opposed by law groups during the hearing including the Nevada Attorneys for Criminal Justice, Nevada District Attorney’s Association, the Clark County Public Defender’s Office, and the Washoe County Public Defenders.

Some opponents of the ban said the “gay panic defense” is rarely used and is not a reliable defense argument. All in opposition said that while they support the LGBT community they believe the ban may have an unintended consequence and could negatively affect a defendant’s right to a fair trial and due process by eliminating defense options and their “right to present a defense.”

California, Rhode Island and Illinois have already banned the defense tactic, but the defense is still theoretically available in federal court. Similar legislation has been introduced in New Jersey, Washington State, New York, Georgia, Minnesota, Pennsylvania, and the District of Columbia.