SANTA FE, New Mexico — The New Mexico state Senate has passed a law that would remove criminal and civil liability for medical professionals who assist in the death of terminally ill patients who have chosen to end their life.

The Elizabeth Whitfield End-of-Life Options Act is named for a former New Mexico judge who testified in support for a right to die for the terminally ill in 2017. She died of cancer the following year.

“She was a judge who could make a decision. And when she did so she did with compassion,” said Democratic Sen. Daniel Ivy-Soto, of Santa Fe, a lawyer who argued in front of Judge Whitfield and later counted her as a constituent. “She said ‘I implore you to give me the choice that is right for me.’”

Supporters of the measure oppose the term “assisted suicide” because patients with uncurable ailments don’t necessarily want to die; they just want to avoid the inevitable pain of their lethal illness.

The law would require a terminal health diagnosis, a physical and mental health evaluation, and a 48-hour waiting period after a lethal prescription is filled. Bill sponsor and Democratic Sen. Elizabeth Stefanics said the entire process would take weeks.

GOP members opposed to the bill compared it to the Senate’s recent repeal of an unenforceable anti-abortion bill.

“There’s elements of partisanship, around this issue, unfortunately, because we do view human life differently,” said Republican Sen. and surgeon Gregg Schmedes, who represents suburbs east of Albuquerque and south of Santa Fe.

He argued that the bill could open the possibility of poorer and less medically literate New Mexicans being pressured to end their life, concluding that under the measure, “the poor lose autonomy.”

Eight other states have legalized assisted suicide.

If passed, New Mexico would become the second state to pass a right-to-die law where a third or more of adults are Catholic, after New Jersey.

Like abortion, assisted suicide is opposed by the Catholic Church.

The Senate passed the bill 24-17, largely along party lines, with Catholics on both sides of the aisle and the vote. Democratic senators Benny Shendo and George Muñoz, both from northwestern New Mexico, also voted against it.