New York lawmakers passed a bill Wednesday outlawing the use of so-called gay and trans panic defenses.

Sponsored by Assemblyman Daniel O’Donnell, a gay Democrat from New York City, Assembly Bill A2707 prohibits defendants from using a victim’s sexual orientation, gender identity or gender expression as a defense in a criminal case.

Once Gov. Andrew Cuomo, who supports the legislation, signs the bill, New York will officially become the sixth state to prohibit such defenses, following California, Rhode Island, Illinois, Nevada and Connecticut.

"With the enactment of this measure we are sending this noxious legal defense strategy to the dustbin of history where it belongs," Cuomo tweeted Wednesday. "This is an important win for LGBTQ people everywhere."

The ban on the 'gay and trans panic' legal defense just passed!



With the enactment of this measure we are sending this noxious legal defense strategy to the dustbin of history where it belongs.



This is an important win for LGBTQ people everywhere. pic.twitter.com/xMpXZfvnDT — Andrew Cuomo (@NYGovCuomo) June 19, 2019

Cuomo has supported other LGBTQ legislation, including a conversion therapy ban and the Gender Expression Non-Discrimination Act (GENDA), which adds gender identity to state discrimination and hate-crime laws — both of which passed earlier this year.

A 2016 study from the Williams Institute at the University of California, Los Angeles, School of Law, found that gay and transgender panic defenses have been employed in approximately half of all states since the 1960s.

A friend of slain transgender woman Islan Nettles hugs another mourner before a vigil for her at Jackie Robinson Park in Harlem on Aug. 27, 2013. Mario Tama / Getty Images

One of the most well-known cases invoking the trans panic defense in New York was the trial in the murder of Islan Nettles, who was beaten to death in Harlem in 2013 after James Dixon discovered she was a transgender woman. At the 2016 trial, Dixon attempted to justify his violence by arguing Nettles provoked him.

“I just don't wanna be fooled,” Dixon said in a taped confession. “My pride is at stake.”

After accepting a deal, Dixon was convicted of first-degree manslaughter and served 12 years in jail — a sentence many advocates deemed too lenient

“In banning the gay and trans panic defense, New York is sending a message to prosecutors, to defense attorneys, juries and judges that a victim’s LGBTQ identity can’t be weaponized,” Sen. Brad Hoylman, a Democrat who wrote the state Senate version of the bill, said in an emailed statement.

Hoylman, the only openly LGBTQ-member of the state Senate, introduced a similar bill banning gay and trans panic in 2014.

A nationwide push to end these defenses is growing, according to the National LGBT Bar Association. Similar legislation has been introduced but not yet passed in New Jersey, Minnesota, Pennsylvania, Washington, Texas and New Mexico. A bill banning gay and trans panic defenses was passed by the Hawaii state Legislature in April and is currently awaiting Gov. David Ige's signature.

“For decades, LGBTQ New Yorkers fought for basic recognition that they mattered under New York law,” Hoylman said. “This session, we’ve made it clear that they do.”

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM