The Supreme Judicial Court heard arguments Wednesday in a case that could decide whether doctors are able to prescribe lethal medicines to terminally ill patients who wish to hasten their own deaths. At odds is whether doctors should be charged with manslaughter for giving life-ending drugs to certain patients.

The Justices seemed to agree that the state Legislature should play a role in any legalization of medical aid in dying. Where they appeared to differ was over what that role should be.

The decision could be left entirely to the Legislature, which has rejected a number of such bills in the past. Or the high court could declare that terminal patients have a constitutional right to this assistance — and the Legislature would be left to sort out the details of how that would be regulated.

The case was brought by Dr. Roger Kligler, a retired 70-year-old Falmouth physician who has advanced prostate cancer. He told GBH News that he watched his mother die a "horrible death" as a result of pancreatic cancer, followed a year later by the death of his father-in-law from an abdominal sarcoma.

"And I decided at that point in time I would not die that way," Kligler told GBH News this week. He was diagnosed with prostate cancer 20 years ago, and said the spreading cancer has caused "a lot of pain and suffering."

In his own medical career as an internist, Kligler said, he treated patients who faced painful and terminal illnesses, and he couldn't legally prescribe drugs that would allow them to end their own lives.

"And I just realized that people need to have a choice at the end of life so that they are able to have less in the way of pain, if they want that choice," Kligler said. "It just has to be an option for them — not to force anyone or tell anyone what to do. But just have it as a choice."

Massachusetts Assistant Attorney General Maria Granik represented the state at the hearing and argued that if access to medical aid-in-dying was recognized by the court as a fundamental constitutional right, it "would have to be available to everyone, rather than [just] patients in this limited group of people who have six months prognoses and are competent and able to self-ingest the medications."

Granik said that’s because the lines are not clearly drawn over who the constitutional right would apply to.

"Your argument isn't so much that it can't be done," Justice Dalila Argaez Wendlandt responded. "It's that it does require a system of regulations on when it could be done, which suggests maybe it's most appropriate for the Legislature to define a set of rules for when something like this could happen."

The state's objection to medical aid-in-dying, Granik argued, comes out of its interest in protecting the lives of its citizens. That prompted a sharp response from Justice Serge Georges, Jr.

"Who's looking out for Dr. Klingler as he's dying, and he's dying painfully?" Georges, Jr. asked. "What interest does the government have in telling him, 'We're not going to let you end your life on your terms. We want you to end it on ours?'"

There's no reason patients should have to die a painful death, Granik replied, given that palliative care is available.

"While patients can get relief in other ways, they don't have the ability to control the exact time and manner of their end of their death," Granik said. "And if the Legislature decided as a result of debate to move the line, it could do so, but it hasn't so far."

The justices also raised questions as to who is responsible for a death if a doctor prescribes life-ending drugs.

John Kappos, Kligler's attorney, described a "chain of self-causation," beginning with the patient's request for the drugs and ending with the patient ingesting them on their own. That chain is not broken, Kappos said, by the intervention of the doctor.

Kappos contrasted this process with that outlined in the prosecution of Michelle Carter, who was found guilty of involuntary manslaughter in 2017 for urging her friend Conrad Roy to kill himself by ingesting fumes from a running truck.

"This court said that had the young man remained in the gas-infused truck and died at the insistence of his girlfriend, she would not have been criminally liable," Kappos said. "It was only when he got out of the truck that broke the chain of self-causation, and then she compelled and pressured him to get back in the truck, that there was criminal liability."

In the case of medical aid-in-dying, he argued, there's no break in the chain of "self-causation," from the time the patient fills their prescription. That means, he said, it's the patient alone who is responsible for their death.

According to SJC rules, the Justices will seek to issue their opinion on this case within the next 130 days.