Italy's top court has ruled that assisted dying is not a crime if the person wanting to end their life is experiencing "intolerable suffering".
The landmark ruling relates to the case of Italian disc jockey Fabiano Antoniani, or DJ Fabo, who chose to die at a Swiss euthanasia clinic in 2017.
Fabo was left blind and tetraplegic by a serious car crash in 2014.
His death became the subject of fierce debate in a country where euthanasia is opposed by the Roman Catholic Church.
The Church, which is highly influential in Italy, sees euthanasia as the morally unacceptable killing of a person and a violation of the law of God.
On Thursday, it said it had "distanced" itself from the decision by the country's constitutional court, which it viewed with "discontent".
The ruling came less than a week after Pope Francis told an audience of hundreds of health professionals at the Vatican to "reject the temptation" to use medicine to "satisfy a sick person's possible wish to die".
"Medicine, by definition, is a service to human life," he said, before quoting his predecessor, Pope Saint John Paul II: "Every doctor is asked to commit himself to absolute respect for human life and its sacredness."
What does the new ruling mean?
Italy's constitutional court said that euthanasia should be permitted by law in the country in certain circumstances, including those in which a patient's irreversible condition was "causing physical and psychological suffering that he or she considers intolerable".
The court was revisiting the question of assisted dying and the "legal framework concerning end of life [situations]", following Antoniani's high-profile case.
Requests had been made by a Milan court to clarify the law in relation to possible charges against pro-euthanasia campaigner Marco Cappato, who accompanied Antoniani on his journey to Switzerland.
Mr Cappato, who was present throughout the court hearing, said the decision meant that "from today we are all freer, even those who disagree".
"The council has decided; those who are in Fabo's condition have the right to be helped," he wrote in a tweet.
Mr Cappato was facing up to 12 years in prison for "instigating or assisting suicide" but he will likely now be acquitted.
Under the previous law, euthanasia was illegal but a patient had the right to refuse care - the potential contradiction led to several cases that divided Italians.
Italy's parliament is now expected to debate the court's decision.
What happened to DJ Fabo?
On 13 June 2014, the much-loved Italian music producer was returning home from a club in Milan when he lost control of his car and collided with another vehicle.
The tragic accident left Antoniani blind and unable to move his arms and legs due to spinal cord trauma. He required assistance breathing and eating.
Antoniani said the crash left him in a world of "physical and mental pain". He fought for his right to die but, unable to gain that right Italy, he chose to end his life at a euthanasia clinic in Switzerland.
"Finally I am in Switzerland and, unfortunately, I got here on my own and not with the help of my country," Antoniani said in an audio message posted on social media shortly before his death.
Antoniani died at a Dignitas facility in Switzerland on 27 February 2017, at the age of 40.
Following Wednesday's court ruling, his former girlfriend Valeria Imbrogno said his "unspeakable" suffering had not been in vain.
"Fabo's body had become a cage and he lived in that prison for two years and nine months," she said, adding: "If a person in these conditions dreams of dying at home, I find it profoundly unfair that someone else should say no."