Portugal's parliament on Friday passed a law allowing medically assisted dying, putting the Catholic-majority country on course to become the fourth in Europe to legalise euthanasia.
Before coming into force the bill must first be signed into law by President Marcelo Rebelo de Sousa, a staunch Catholic and conservative who was re-elected only last weekend.
The president - who has yet to make public his position on the issue - could also either use his veto against the legislation, or refer it to the country's constitutional court for further study.
The bill was adopted in parliament by 136 votes to 78 with four abstentions - thanks largely to a majority of votes from the ruling Socialist Party which had allowed its MPs to vote freely.
If the president did decide to exercise his veto, a second vote by lawmakers would override it.
Lawmakers had approved proposals aimed at changing the law in February, setting up the vote despite a campaign by the Church for a national referendum on the issue.
The bill legalises access to assisted suicide for adult patients in a situation of "extreme suffering and irreversible damage".
Several doctors must green-light the procedure, while a psychiatrist would be called in if there are doubts about the patient's ability to make a "free and informed" choice.