Doctors in the Netherlands are able to carry out euthanasia on patients with severe dementia without fear of prosecution even if the patient no longer expresses an explicit wish to die, the country’s highest court has ruled.

The supreme court’s decision followed a landmark case last year in which a doctor was acquitted of wrongdoing for euthanising a woman in 2016 with severe Alzheimer’s who had requested the procedure before her condition deteriorated.

The case caused controversy in the Netherlands because the unnamed woman had to be restrained by her family as she was euthanised, having been given a sedative in her coffee beforehand.

Prosecutors accused the doctor of going through with the euthanasia without properly consulting her client, saying the 74-year-old woman might have changed her mind about dying.

Lower Dutch courts acquitted the doctor of wrongdoing and prosecutors dropped the charges. The case was referred to the supreme court for a legal clarification “in the interest of the law”.

The Hague-based court ruled: “A physician may carry out a written request beforehand for euthanasia in people with advanced dementia.”

But it would have to be under the strict rules for euthanasia, including that the patient must have “unbearable and endless suffering” and that at least two doctors must have agreed to carry out the procedure.

The patient must also have requested euthanasia before they could “no longer express their will as a result of advanced dementia”.

Tuesday’s verdict underscored similar judgments in the lower courts, which also agreed that the 64-year-old doctor followed the correct procedures prescribed by the government.

The case was seen as an important test of the law in the Netherlands, which legalised euthanasia in 2002, followed shortly afterwards by neighbouring Belgium.