Spain's parliament voted through a law legalising euthanasia Thursday, becoming one of the few nations to allow terminally-ill or gravely-injured patients to end their own suffering.
A priority for Socialist Prime Minister Pedro Sanchez's government, the law was drafted following public pressure generated by several high-profile cases, notably that of Ramon Sampedro whose plight was immortalised in the Oscar-winning 2004 film "The Sea Inside".
The vote, which passed by 202 in favour and 141 against and two abstentions in the 350-seat chamber, makes Spain the fourth European nation to decriminalise assisted suicide, alongside the Netherlands, Belgium and Luxembourg.
Although Portugal's parliament passed a similar law in January, it was blocked this week by the Constitutional Court.
"Today we have become a country that is more humane, fairer and freer. The euthanasia law, widely demanded by society, has finally become a reality," Sanchez tweeted just minutes after the vote.
"Thanks to all the people who have fought tirelessly for the right to die with dignity to be recognised in Spain."
The Spanish legislation will permit euthanasia in which medical staff intentionally end a life to relieve suffering, and assisted suicide in which it is the patient who carries out the procedure.
Various other countries permit assisted suicide as well as "passive euthanasia" in which life-saving medical treatment is halted.
Speaking to AFP, Ramona Maneiro, a friend of Sampedro's who was arrested for helping him die but not prosecuted for lack of evidence, hailed the move as a victory "for those who can benefit from it" and "for Ramon".
Backed by leftwing and centrist parties, the legislation allows anyone with a "serious or incurable illness" or a "chronic or incapacitating" condition to request help dying, thereby avoiding "intolerable suffering".
But the patient must be a Spanish national or a legal resident and must be "fully aware and conscious" when they make the request, which must be submitted twice in writing, 15 days apart.
However a doctor can reject the request if the requirements have not been met; it must be approved by a second medic and by an evaluation body.
Any medic can withdraw on grounds of "conscience" from taking part in the procedure that would be available through Spain's national health service.
The move has been hailed by patients and right-to-die campaigners.
"It doesn't make any sense that people... would choose to live an undignified life," said Sofia Malagon, 60, who has Parkinson's and worries what will happen if she gets dementia.
"I don't want to be left like a vegetable."
But the move has been roundly rejected by the Catholic Church and Spain's right and far-right opposition, and some medics have raised questions about its implementation.
Euthanasia "is always a form of murder since it involves one man causing the death of another," said the Episcopal Conference that groups Spain's leading bishops.
"Life cannot be left in the hands of the authorities," said Lourdes Mendez Monasterio, an MP for the far-right Vox party which has vowed to appeal to the Constitutional Court.
"We will not rest until ensuring that at the end of life, a person can die with dignity without pain and without being killed," she told the chamber.
Since the mid-1980s when euthanasia first entered the public debate, the most famous case has been that of Ramon Sampedro, who became a tetraplegic after breaking his neck and fought an unsuccessful 30-year court battle to end his own life with dignity.
He died in 1998 with the help of his friend with his story told in "The Sea Inside" starring Hollywood actor Javier Bardem that won the 2005 best-foreign language Oscar.
A different but equally high-profile case was that of Luis Montes, an anaesthetist accused of causing the deaths of 73 terminal patients at a Madrid hospital. A court dropped the case against him in 2007.
More recently, pensioner Angel Hernandez was arrested in 2019 and is awaiting trial for helping his wife end her life after decades suffering from multiple sclerosis.