Spain is set to become the fourth country in Europe and the sixth in the world to legalize euthanasia.
Legislation backed by the ruling PSOE Party was passed by Spain's parliament on Thursday. It now needs final approval from the Senate to become law but is not expected to face any opposition there.
Once it has been approved by the Senate, it's expected to come into effect in the first half of 2021.
The legislation was passed despite strong opposition from religious groups. As the vote was taking place, protesters gathered outside Parliament with placards that read: "Government of death."
The Spanish Evangelical Alliance issued a statement earlier this year saying that the government should help people with "hopelessness and pain," instead of legalizing euthanasia.
"The number of patients who consider euthanasia as an option diminishes drastically if the alleviation of pain is facilitated, and human accompaniment and resources to combat hopelessness is offered," it said.