Lawmakers in Virginia have approved a bill that bans the use of the so-called gay and transgender panic defense in criminal trials.

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.

According to the Washington Blade, the Virginia House of Delegates approved House Bill 2132 on Friday, February 26 with a 58 to 39 vote. It passed the Senate on Thursday with a 23-15 vote.

Delegate Danica Roem, a Democrat from Manassas, sponsored the bill.

“It's done,” Roem tweeted. “We're banning the gay/trans panic defense in Virginia.”

Speaking with NBC 4, Roem added: “This [bill] means someone's mere existence as an LGBTQ person does not excuse someone else and does not constitute a reason of provocation to commit such a heat of passion attack.”

Such a defense has been used in at least eight instances in Virginia.

Governor Ralph Northam, a Democrat, is expected to sign the bill into law.

Similar laws have been enacted in the District of Columbia and 11 states, including Washington, New Jersey, New York, California, Hawaii, Colorado, Connecticut, Maine, Illinois, Nevada, and Rhode Island.