A Dutch court on Wednesday acquitted a doctor over euthanising a woman with severe dementia in a landmark case for the Netherlands, the first country in the world to legalise euthanasia.

The case attracted media attention due to details of how the unnamed patient was given a sedative in her coffee but had to be restrained by her family as the now-retired doctor injected the euthanasia drug.

Prosecutors had accused the doctor, named only as Catharina A., of failing to properly consult the 74-year-old Alzheimer’s patient in the case in 2016, saying that the woman may have changed her mind.

Applause broke out in the courtroom after judges ruled that the doctor was right to abide by the woman’s wish, expressed four years earlier, to be euthanised instead of being placed in a care home.

“We conclude that all requirements of the euthanasia legislation had been met. Therefore the suspect is acquitted of all charges,” judge Mariette Renckens said at the court in The Hague.

“We believe that given the deeply demented condition of the patient the doctor did not need to verify her wish for euthanasia.”

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

Euthanasia can only be carried out under strict conditions set down in Dutch law, including that the patient must have “unbearable and endless suffering” and have requested to die “earnestly and with full conviction”.