Portugal’s Parliament has voted in favour of allowing euthanasia and doctor-assisted suicide for terminally ill people.

The landmark ruling left Portugal poised to become one of the few nations in the world permitting the procedures.

However, Portuguese President Marcelo Rebelo de Sousa could still try to block the legislation.

The Parliament approved all five of the right-to-die bills by comfortable margins.

Before MPs voted, hundreds of people outside the parliamentary building in Lisbon protested the measures, with some holding up crucifixes and religious effigies, and chanting “Sim a vida” (“Yes to life”).

One banner read: “Euthanasia doesn’t end suffering, it ends life”.

Inside the government building, MPs were called, in alphabetical order, to state their vote on each bill, instead of deciding electronically.

The bills were approved by margins of between 28 and 41 votes.

Mr Rebelo de Sousa, who is known to be reluctant about euthanasia, could veto the new law, but the Parliament would be able to override him by voting a second time for approval.

The head of state also could ask the Constitutional Court to review the legislation because the law states that human life is “sacrosanct,” although abortion has been legal in the country since 2007.

Euthanasia is when a doctor directly administers fatal drugs to a patient.

Allowed in Victoria and Western Australia, it is also legal in Belgium, Canada, Colombia, Luxembourg, the Netherlands and Switzerland.

Isabel Moreira, of Portugal’s Socialist Party, said bills aimed to let people “make intimate choices, without breaking the law”.

The Socialist Party has also been behind successful efforts to permit same-sex marriages and abortion in the country.

“Everyone can be the architect of their own destiny, as long they don’t harm others,” Ms Moreira said during the debate.

Echoing the views of some religious leaders in Australia, the Catholic church in Portugal has led opposition to euthanasia, which can carry prison sentences of up to three years.

Church groups have urged politicians in vain to hold a referendum on the issue.