NEW DELHI - India’s top court ruled Friday that terminally ill patients have the right to refuse care, approving the use of “living wills” to set out how they want to be treated.

The Supreme Court’s order - hailed as “historic” by petitioners - means medical treatment can be withdrawn to hasten a person’s death, a practice known as passive euthanasia.

The ruling means the family of someone in a permanent vegetative state and unable to communicate could withdraw life support in accordance with the patient’s wishes.

The justices gave the green light to living wills, legal documents that allow adults to express their preference on how they want to be treated if they become terminally ill or slip into an incurable coma.

It enshrines the right to refuse care, although under strictly controlled conditions.

“Life sans dignity is an unacceptable defeat and life that meets death with dignity is a value to be aspired for and a moment for celebration,” the five-judge bench, headed by India’s chief justice, said in its order.

“The question that arises is should he not be allowed to cross the doors of life and enter, painlessly and with dignity, into the dark tunnel of death whereafter it is said that there is resplendence.”

The court said its guidelines set out “will prevail until the government comes out with legislation”.

The Press Trust of India news agency said that in each living will, a court-appointed medical panel will review the instructions before they can be carried out.

The 2015 death of 66-year-old nurse Aruna Shanbaug, who was raped and left in a vegetative state for 42 years, reignited India’s national debate over euthanasia.

Her plight prompted the Supreme Court to decide in 2011 that life support can be removed for some terminally ill patients in certain circumstances.

“It is an important, historic decision,” Prashant Bhushan, a lawyer and one of the petitioners, told reporters after the hearing.

With the latest decision, India joins a growing list of countries including Britain, France, Germany and Spain that recognise living wills.

Indian law does not permit active euthanasia or assisted suicide, in which patients are helped by doctors to end their lives.