A pair of congressional lawmakers from Massachusetts have introduced a bill that would ban the use of “gay panic” and “trans panic” defenses in federal court.

The Gay and Trans Panic Defense Prohibition Act, sponsored by Sen. Edward Markey (D) and Congressman Joseph Kennedy III (D), would prevent defendants from attempting to use a victim’s sexual orientation or gender identity as justification for violent crimes, including murder and assault.

The bills would also require the Attorney General submit an annual report to Congress detailing prosecutions in federal court involving crimes committed against the LGBTQ+ community that were motivated by the victim’s sexual orientation or gender identity.

Typically, gay and trans panic defenses paint LGBTQ people as sexual predators preying on straight victims, or argue that defendants are not responsible for their actions because mere knowledge of the victim’s identity provoked them and made them act in an irrational manner.

Such defenses have been employed — though not always successfully — in many high-profile hate crimes or murders, including the killings of Matthew Shepard, the openly gay college student killed in Laramie, Wyo., in 1998; Gwen Araujo, a transgender teenager killed in 2002; Ahmed Dabarran, a gay assistant district attorney in Fulton County, Ga., in 2003; and Angie Zapata, a transgender woman killed in Colorado in 2008, among others.

“Claiming a victim’s sexual orientation or gender identity justify murder or assault expressly tells entire segments of our society that their lives are not worthy of protection,” Kennedy said in a statement. “As long as gay and trans panic defenses are allowed in our state and federal courts, the LGBTQ community will be deprived of the justice all Americans deserve. With four states already implementing bans, we have the federal momentum to outlaw this bigoted legal practice across the country.”

The four states that currently outlaw the use of gay and trans panic defenses are: California, Illinois, Nevada, and Rhode Island. Bills seeking to prohibit the defense tactic have been introduced but stymied by legislative inaction in New Jersey, Washington, New York, Minnesota, Pennsylvania, Maine, Texas, New Mexico, Connecticut, Hawaii, and the District of Columbia.

“Our courtrooms are supposed to be chambers of justice, not hate,” Markey said in a statement. “So-called gay and trans panic legal defenses perpetuate bigotry and violence toward the LGBTQ community and should be banned. They corrode the legitimacy of federal prosecutions, and blame victims for the violence committed against them.

“All Americans deserve to be treated with dignity and humanity in our justice system,” Markey added. “As we celebrate Pride Month with our LGBTQ brothers and sisters, I call on my colleagues to support this bill and relegate hateful practice of gay and trans panic defense to the history books.”

Markey’s Senate bill is being co-sponsored by 8 Democrats and two independents, Sens. Bernie Sanders (Vt.) and Angus King (Maine). Kennedy’s House version of the bill is being co-sponsored by 26 other lawmakers, all Democrats.

The National LGBT Bar Association, which has called for banning gay and trans panic defenses for more than a decade, praised the introduction of the bill.

“Gay and trans ‘panic’ defenses have long stood as a symbol of dangerous and outdated thinking,” D’Arcy Kemnitz, the executive director of the National LGBT Bar Association, said in a statement. “The Gay and Trans Panic Defense Prohibition Act would protect LGBTQ+ lives and send a clear message that hate has no place in the federal courtroom.”