The Netherlands Supreme Court ruled in a landmark case Tuesday that doctors may legally euthanize patients with advanced dementia if a previously written request exists.

This is permissible even if the patient is no longer able to follow up on the request due to deteriorating mental condition or gives “mixed signals” as was claimed by the prosecution.

"A doctor may respond to a written request for granting euthanasia to people with advanced dementia. In such a situation, all legal requirements for euthanasia must be met, including the requirement that there is hopeless and unbearable suffering. The doctor is then not punishable," the Supreme Court said in a statement Tuesday.

The case began in 2016, when a nursing home doctor euthanized a 74-year-old patient. The doctor claimed he was following through with a written directive to end her life if "she was admitted to a nursing home with dementia and she thought the time was right," CNN reported.

Prosecutors raised questions of consent, but the court ruled the doctor acted in accordance with the law.

Euthanasia has been legal in the Netherlands since 2002. The “Termination of Life on Request and Assisted Suicide (Review Procedures) Act” codified euthanasia practices and physician-assisted suicide.

»RELATED: Portugal's parliament rejects legal euthanasia

Few other countries have followed suit, although some distinguish between "assisted dying" and euthanasia, according to The Week UK.

For example, in California, Colorado, Hawaii, Vermont, Washington, New Jersey, Montana and Washington, D.C., physician-assisted suicide is legal in cases of terminal illness.

In the U.S., the National Institute on Aging classifies dementia as a terminal illness. However, dementia patients do not usually qualify. Laws in the U.S. require patients to have sound mind when making the decision, according to BeingPatient.com, an Alzheimer's research and news site.

»MORE: Assisted suicide now legal in Hawaii for patients with terminal illness

Laws around such a sensitive topic of end-of-life care remain fraught, so the Netherlands’ top medical official thought clarification was a good step.

"It is good that there is now a ruling from the Supreme Court. But even with more legal clarity, not all complicated dilemmas around euthanasia in the case of dementia are gone," said René Héman, president of the Royal Dutch Medical Association, in a statement.

“With every request to end a life, a doctor must still make an individual assessment if euthanasia is appropriate and if all due care criteria are met. Doctors act according to professional standards and also on their moral compass. The doctor’s own consideration is and remains very important,” he said.

»Click here to get the new AJC Mobile App