New York state lawmakers took another step Tuesday toward ending the so-called “gay panic” and “trans panic” defenses, which allow those facing murder charges to say their actions were driven by an extreme emotional disturbance incited by a victim’s sexual orientation or gender identity.

The State Senate approved legislation that would bar individuals from using that defense, which has been sharply criticized by the New York State Bar Association and others within the legal community.

The bill was approved unanimously by members from both major parties, after the measure had been stalled in the Legislature since it was first introduced four years ago.

But lawmakers in the Senate may have to do so again in the coming days; the sponsor of the bill in the Assembly said staff from both chambers are working on what could be an amended version of the bill with different language.

“We are having ongoing negotiations about language, and I believe those negotiations are with the counsel in the Senate,” said Assemblyman Daniel O’Donnell, D-Manhattan. “They should be aware that changes might be coming. We’re not going to pass it until negotiations are complete, but I’m hopeful we can get that done.”

The measure is sponsored in the State Senate by Sen. Brad Hoylman, D-Manhattan, who has carried the bill with O’Donnell since 2015. Hoylman said he’s heard Democrats in the Assembly are willing to approve the measure, which is a change from last year when it failed to move in either chamber.

“We’ve heard good reports from the Codes Committee,” Hoylman said. “So, we’re hopeful with us passing it today they’ll simply join us and pass it as well.”

The bill wouldn’t eliminate the option completely for a defendant to say they were influenced by and extreme emotional disturbance, but it would set limits on that defense.

The legislation, as it’s written now, would modify the state penal law by saying that a nonviolent sexual advance, or the discovery of a person’s sexual orientation or gender identity, could not be used to explain or excuse a defendant’s action. The legislation would only apply in cases where an individual is charged with murder in the second degree, according to the bill.

Democrats in the Senate also approved a bill Tuesday that would allow women to act as paid surrogates for couple who can’t physically have children on their own, including same-sex couples and those facing infertility. That measure passed mainly along party lines.

Both issues have been a last-minute priority for Gov. Andrew Cuomo, who named them among a list of priorities for lawmakers to address before they’re scheduled to leave Albany for the year later this month. Cuomo called on lawmakers to give final passage to the measures in a press event Tuesday morning.

“There is no such thing as a celebration of one house passing a bill, because one house passing a bill means nothing,” Cuomo said. “It takes two to tango, it takes two to pass a bill.”

It’s unclear when the Assembly is planning to consider either measure. O’Donnell said they’re waiting until a final bill to eliminate the “gay panic” and “trans panic” defenses is negotiated by staff between both chambers.

The defenses are not commonly used, but Cuomo said the fact that defendants in New York even have the option is “disgusting.”

“It’s so disgusting, is the only word,” Cuomo said. “It’s unbelievable. It is incredible. It just cannot be allowed to exist, not just as a legal defense, but what it says about us and what it says about our values and what we believe, that we would allow that proposition to stand.”

Hank Greenberg, the newly minted president of the New York State Bar Association, was with Cuomo on Tuesday morning to support the legislation. He said having a law on the books that allows defendants to use such a defense goes against the value of equal justice with respect to members of the LGBTQ community.

“The ‘gay panic defense’ is based on the horrific, noxious concept that LGBTQ lives are worth less than others,” Greenberg said. “That concept is violative to our core values as people and the very antithesis to equal justice under the law.”

Cuomo has credited Hoylman and O’Donnell for bringing the issue to light in recent years. The legislation was partly inspired by the story of a transgender woman, Islan Nettles, who died in 2013 after she was struck by a man who discovered her gender identity.

Her assailant was sentenced to 12 years in prison after using the defense. He said at the time that, when Nettles revealed she was transgender, he became enraged and attacked her because of it. He later turned himself into the police and entered a guilty plea.

Lawmakers have less than two weeks to come to an agreement on the legislation before they’re scheduled to leave Albany for the year June 19.

READ MORE:

Cuomo Blasts Democrats in NY Legislature Over Delay in Abolishing ‘Gay Panic’ Defense

Cuomo Plans New Push to End ‘Gay Panic’ Defense by End of Session

Cuomo Says Senate Votes Aren’t There to Legalize Marijuana for Recreational Use in NY