Massachusetts Senator Edward Markey and Representative Joe Kennedy, both Democrats, have introduced a bill that seeks to end the use of so-called “gay panic” and “trans panic” defenses in federal court.

The Gay & Trans Panic Defense Prohibition Act is also sponsored by Connecticut Senator Richard Blumenthal and Rhode Island Representative David Cicilline, both Democrats.

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.

Kennedy, an outspoken advocate for LGBT rights, told the Washington Blade that committing an act of violence against a person after discovering they're LGBT is a “hate crime,” not a defense.

“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,” he said.

“Gay and trans panic legal defenses reflect an irrational fear and bigotry toward the LGBTQ community and corrode the legitimacy of federal prosecutions," Markey said. "These defenses must be prohibited to ensure that all Americans are treated with dignity and humanity in our justice system."

Using “gay panic” as a defense is currently banned in California, Rhode Island and Illinois.

(Related: Texas man avoids murder charge with “gay panic” defense.)