California Governor Jerry Brown has signed into law a bill which outlaws the use of the so-called “gay panic” legal defense.

The bill passed the state Assembly by a 58 to 15 vote and the Senate by a 25 to 9 vote.

The measure prohibits use of the defense to downgrade a murder charge to manslaughter.

A defendant using the “gay” or “trans” panic defense claims that he or she acted in a state of temporarily insanity which was triggered by the revelation of a victim's sexual orientation or gender identity, either actual or perceived. California's first-in-the-nation law outlaws both defenses.

The American Bar Association (ABA) House of Delegates last year approved a resolution calling on local jurisdictions to outlaw the defenses.

“These defense strategies seek to excuse the crimes by saying that the victim's sexual orientation caused their assailant's violent reaction to them,” The ABA Journal wrote at the time. “The ABA recommends that courts, when asked, instruct juries to ignore the victim's gender or sexual orientation in its deliberations; it also recommends that laws might ban any use of such defenses in noncapital cases.”

The National LGBT Bar Association has been working to curb use of the “gay panic” and “trans panic” defenses for more than a decade.