Doctors on Tuesday agreed to turn off a 12-year-old girl's life support after her parents campaigned for her to be allowed a "dignified death", sparking a nationwide debate on euthanasia.
Andrea, from Galicia, northwestern Spain, was taken off life support after pleas from her parents that were originally denied by doctors.
The pediatrics department at the Hospital Clínico in Santiago de Compostela had initially refused to take the child off life support, rejecting the recommendations of the regional government's bioethics committee that she be taken off the machines.
Her parents, Estela Ordóñez and Antonio Lago, argued that their daughter was in pain, a claim the hospital denied - which forced the couple to turn to the courts. A Santiago court ordered four expert reports into the issue to determine whether the life support was "unnecessarily prolonging the child's agony".
But on Monday the couple's lawyer, Sergio Campos confirmed that Andrea had been taken off life support after meeting with her medical team.
She would have a "dignified death" as her parents had requested, he told reporters outside the hospital.
Doctors are currently providing Andrea with "a minimum level of hydration" so that her medication can take effect. She could die within a matter of days.
"It could be two, four, eight, or 38 days," said the lawyer, adding that Andrea's death would be "a bit easier than her life" had been.
Andrea's parents have asked for privacy at this time as they "prepare to say goodbye" the lawyer said.
Campos said he did not know the reason why the medical team had changed their position, but he "suspected" they were motivated by the fact that the family had taken the case to court and that Santiago judge Roberto Soto was investigating the case.
The case has sparked a wider debate on euthanasia in Spain.
Galician health chief Rocío Mosquera supported the doctors' original position and said Andrea's parents request amounted to "active euthanasia".
Meanwhile the head of Spain's Socialist party (PSOE), Pedro Sánchez, who has said he will regulate euthanasia if he wins December's general election, joined the Right to Dignified Death Association to call for a public debate on decriminalizing euthanasia and assisted suicide.
Andrea's parents campaigned tirelessly for the right for their daughter to "die with dignity".
"We don't want to see her in agony, emaciated, in so much pain and unable to even recognize us," they said.
Spain's health ministry denied the need to open a debate on assisted suicide following the case.
Speaking on Spanish television station TVE, Health Minister Alfonso Alonso praised the "courage" of Andrea's parents but said he thought the current Patient's Freedom Law already protected patients in similar situations.
"Opening this debate would be uncomfortable for everyone," he said.
The regional governments of Andalusia, the Canary Islands, Aragon, Navarre, the Balearic Islands and Galicia all have their own dignified death laws, and the Basque Country is in the process of drafting its own version.