Uruguay’s senate passed a law decriminalizing 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. Colombia and Ecuador have decriminalized the practice through Supreme Court decisions.

The law, which moved forward in fits and starts over the last five years, cleared its final hurdle as 20 out of 31 senators voted in favor.

The lower house approved the bill in August with a large majority.

All that's left is for the government to implement the regulations.

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 legalize marijuana for recreational use and passed pioneering legislation allowing same-sex marriage and abortion over a decade ago.

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.

Unlike laws in U.S. states, Australia and New Zealand restricting euthanasia to those with a life expectancy of no more than six months or a year, Uruguay sets 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.

Unlike Belgium, Colombia and the Netherlands, Uruguay will not allow euthanasia for minors.

AP Video by Diego Casal