Two Congressional Democrats have introduced bills in Congress to ban the gay and trans panic defenses.

Representative Joseph Kennedy (D-MA) and Senator Edward Markey (D-MA) introduced the Gay & Trans Panic Defense Prohibition Act in their respective chambers. The bill would ban the gay and trans panic defense in federal courts.

While it’s not an officially recognized defense strategy, the gay panic defense is used in cases where a straight person assaults or kills a gay person. Instead of saying they didn’t do it, the defendant argues that they were so upset that a gay person made a sexual advance towards them that they momentarily lost control, helping them to claim insanity or diminished capacity.

The related trans panic defense argues that the defendant lost control when they found out that the victim is transgender.

Kennedy said that admitting to killing someone because they’re gay or transgender “is not a defense, it is a hate crime.”

“Legal loopholes written into our laws that seek to justify violent attacks against our gay, lesbian, bisexual and transgender neighbors should never have existed in the first place,” Kennedy said.

In April, the American Bar Association sent a letter to Markey asking for the gay and trans panic defense to be banned.

“These defenses have no place in either our society or justice system and should be legislated out of existence,” the letter said. The American Bar Association adopted a resolution calling for an end to the defense in 2013.

The gay panic defense has been used in several prominent cases. It gained national attention in a 1995 case where a gay man, Scott Amedure, told his straight friend Jonathan Schmitz that he was attracted to him on the Jenny Jones Show.

Three days later, Schmitz shot Amedure and turned himself into police, and he argued in court that he was “embarrassed” on national TV. He avoided a first-degree murder conviction and was convicted of second-degree murder.

The men who killed Matthew Shepard also tried to argue that they were “enraged” to the point of murder because Shepard made a sexual advance toward them. The judge did not allow that defense, and they later changed their story.

The trans panic defense was used by the three men who killed Gwen Araujo in 2004. After having sex with the transgender teen, the men found out that she was transgender.

They called it “a sexual violation ‘so deep it’s almost primal’.” Their first trial ended in a jury deadlock.

California, Illinois, and Rhode Island have already banned the gay and trans panic defense.