New York is set to become the sixth state to ban the so-called "gay panic" defense in murder cases, which defendants sometimes use to try to justify an attack on an LGBTQ victim. The state legislature passed the ban during Pride Month, and just days before the 50th anniversary of the Stonewall riots in New York City, which sparked the gay rights movement.

"With the enactment of this measure we are sending this noxious legal defense strategy to the dustbin of history where it belongs," New York Gov. Andrew Cuomo, who is expected to sign the legislation, said in a statement. "This is an important win for LGBTQ people everywhere."

"Gay panic" or "trans panic" defenses claim that an accused assailant may have acted in a temporary state of insanity in reaction to an encounter with a gay or transgender person. New York had its own high-profile case in 2013 after a man fatally attacked a transgender woman named Islan Nettles on a street in Harlem. The attacker said he was flirting with Nettles, and went into a "fury" after learning she was a transgender woman. He said his friends started mocking him and he "didn't want to be fooled."

Get Breaking News Delivered to Your Inbox

The attacker pleaded guilty to manslaughter and was sentenced to 12 years in prison — a sentence Nettles' family said was too lenient.

"Gay panic" and "trans panic" defenses have helped acquit dozens of accused killers, and were successfully used as recently as April 2018, according to the LGBT Bar. The American Bar Association passed a resolution in 2013 urging state governments to ban such defenses.

California, Illinois, Connecticut, Nevada and Rhode Island have already passed bans, and several other state legislatures are considering similar measures.

Sen. Edward Markey and Rep. Joseph Kennedy III, both Democrats from Massachusetts, introduced a federal ban on the defenses last year, but the bills died in committee. They reintroduced the bills this month.