LISBON (Reuters) - Portugal’s parliament rejected on Tuesday a bill that would have legalized voluntary euthanasia for terminal patients in the Catholic-majority country by a narrow margin, but it secured enough support to ensure continued debate on the issue.

Slideshow ( 10 images )

Drafted by the ruling Socialists, the bill garnered 110 votes in the 230-seat parliament but was stymied by 115 opponents, with 4 abstentions, after a heated debate and a vote that required each lawmaker to declare his or her stance.

Earlier, a few hundred people of all ages - mostly from religious groups and Catholic schools - protested in front of the parliament building, chanting “Yes to life, no to euthanasia!” and carrying placards, “We demand palliative care for ALL” and, “Euthanasia is a recipe for elder abuse”.

The Portuguese Doctors’ Association opposed the change, saying it violated key principles of the medical profession.

Proponents of the bill, which was inspired by a 2016 petition signed by over 8,000 people and promoted by groups defending the right to a “death with dignity” for those seriously ill, said the fight had only just begun.

“The issue is now firmly on the political agenda, it is now in detailed debate in society,” said Catarina Martins, leader of the Left Bloc - a key government ally in parliament, which had its own version of a legalization proposal.

“It is no longer a problem that each family with a suffering loved one has to face on its own, it now becomes a problem for all of us to find answers to...The state cannot continue to close its eyes to the suffering,” she said.

Another of the government’s hard left allies, the Communists, voted against the legislation, joining the conservative CDS-PP on the other end of the political spectrum. Several lawmakers from the main opposition Social Democrats supported the bill, but that was not enough to get it passed.

The Socialist bill envisaged legalization for medically-assisted death based on an informed request by patients suffering profoundly from a serious, incurable illness with no expected improvement in sight, in a terminal state, or suffering from widely incapacitating lesion.

On a national level, only a few countries in the world have legalized euthanasia - which usually means a doctor administering lethal doses of drugs to patients willing to die - or medically-assisted suicide where patients take the final action themselves.

Laws in Belgium, the Netherlands, Colombia and Luxemburg allow euthanasia. In Switzerland, Germany, Japan and Canada, doctor-assisted suicide is legal.

Portugal, which spent a large part of the 20th century until the 1974 Carnation revolution ruled by an ultra-conservative fascist regime, has since made strides in liberal reforms upholding human rights.

It legalized abortions in 2007 and then allowed same-sex marriage in 2010, becoming only the eighth country in the world at the time to allow same-sex marriage nationwide.