Officials hailed the law's passage as reinforcing Uruguay's reputation as among the most socially liberal nations in the region.
Uruguay’s senate passed a law decriminalising euthanasia on Wednesday, putting the South American nation among a handful of other countries where seriously ill patients can legally obtain help to end their lives.
It makes Uruguay the first country in predominantly Catholic Latin America to allow euthanasia via legislation.
The legislation permits euthanasia, performed by a healthcare professional, but not assisted suicide, which involves a patient self-administering a lethal dose of prescribed medication.
"Public opinion is asking us to take this on," Senator Patricia Kramer of Uruguay's governing leftist coalition told lawmakers in Montevideo.
The law, which has moved forward in fits and starts over the last five years, cleared its final hurdle on Wednesday as 20 out of 31 senators voted in favour.
The lower house approved the bill in August with a large majority. All that's left is for the government to implement the regulations.
During the debate, senators from the ruling Broad Front coalition delivered impassioned defences of the right to die, comparing the euthanasia movement to the legalisation of divorce and same-sex marriage.
Fierce debates and spirited activism around the practice has gripped the region in recent years.
"We all believe and feel that life is a right, both in health and in sickness, but it should never be an obligation because others don’t understand such unbearable suffering," Seator Daniel Borbonet said after quoting testimony from Uruguayan patients with irreversible medical conditions.
Opposition from the church
Most opposition to euthanasia in Uruguay came from the Catholic Church. Before the vote, Daniel Sturla, the archbishop of Montevideo, called on Uruguayans "to defend the gift of life and to remember that every person deserves to be cared for, accompanied and supported until the end."
But secularisation has eroded resistance to the practice in this country of 3.5 million people, which bans any mention of God in oaths of office and calls Christmas "Family Day."
Officials hailed the law's passage as reinforcing Uruguay's reputation as among the most socially liberal nations in the region.
The country was first in the world to legalise marijuana for recreational use and passed pioneering legislation allowing same-sex marriage and abortion over a decade ago.
"This is a historic event, which places Uruguay at the forefront in addressing deeply human and sensitive issues," Vice President Carolina Cosse said.
Unlike laws in some US states, Australia and New Zealand restricting euthanasia to those with a life expectancy of no more than six months or a year, Uruguay has set no time limits.
It also not does require a waiting period and allows anyone suffering from an incurable illness that causes "unbearable suffering" to seek assisted death, even if their diagnosis is not terminal.
Uruguay requires that those seeking euthanasia to be mentally competent.
Although the law does not outright ban euthanasia for those with mental conditions like depression, it requires that patients get two doctors to rule that they are psychologically fit enough to make the decision.
However, unlike Belgium, Colombia and the Netherlands, Uruguay will not allow euthanasia for minors.