BRUSSELS — Belgian lawmakers voted overwhelmingly Thursday to extend the country’s euthanasia law to incurably ill children enduring insufferable pain. King Philippe was expected to sign the measure into law and make Belgium the first country to lift all age restrictions on legal, medically induced deaths.

Under the measure — approved by the lower house of Parliament in an 86-44 vote, with 12 abstentions — euthanasia would be permissible for terminally ill children who are close to death, experiencing “constant and unbearable suffering” and capable of showing “discernment,” meaning they can demonstrate they understand the consequences of such a choice.

The measure is an amended version of a 2002 law that gave adults the right to die and extends the right to those younger than 18. The legislation also requires that a request for euthanasia include the written consent of the parents.

The law has wide public support but was opposed by some pediatricians and the country’s Roman Catholic clergy. As lawmakers cast their ballots and an electronic tally board lit up with enough green lights to indicate the measure would carry, a lone protester in the chamber shouted “assassins!”

Unlimited Digital Access. $1 for 4 weeks.

Hans Bonte, a Socialist, said no member of the lower house hopes the law will be used. But he said all Belgians, including minors, deserved the right to “bid farewell to life in humane circumstances” without having to fear they were breaking the law.

Thursday’s vote came after approval by the upper house, or Senate, in December.

Laurent Louis, an independent lower-house member who opposed the legislation, said the majority of his colleagues were violating the natural order. “A child is to be nurtured and protected, all the way to the end, whatever happens,” Louis said. “You don’t kill it.”

A fellow lawmaker, Catherine Fonck, said the legislation was riddled with flaws and didn’t address the possibility that one parent may favor euthanasia while the other is opposed.

All 13 proposed amendments seeking changes in the bill were defeated.

The measure spurred emotional debate. Opponents, including religious leaders, some medical professionals and conservative politicians, argued that modern medicine can alleviate suffering among the very sick and that euthanasia of minors could lead Belgian society down a perilous ethical path.

This week 160 Belgian pediatricians signed an open letter arguing that there was no urgent need for the law and that science and medicine were capable of relieving the worst suffering of terminally ill children.

Demonstrators also took to the streets in Brussels to protest. Some carried signs that read: “Care! Do Not Kill.”

Philippe Mahoux, a Socialist Party senator who sponsored the legislation, said Thursday that the law would affect only a small number of terminally ill young people, such as cancer patients with no hope of successful treatment.

“This is an act of humanity that allows the doctor to make the most humane course of action for his patient,” said Mahoux, who trained as a surgeon. “What is scandalous is the suffering of sick children when they are going to die.”

As for the contention by some critics that sick children are ill-equipped to confront the choice of dying, he said that suffering from a terminal illness endowed young people with a maturity sometimes lacking in many adults.

During a debate Wednesday, members of the Socialist Party said that giving terminally ill children the right to die was a matter of mercy and humanity.

“It is our responsibility to allow everyone to live and die with dignity,” Karine Lalieux, a Socialist lawmaker, was quoted as saying by Le Soir, a Belgian newspaper.

According to a survey conducted by another newspaper, La Libre Belgique, three-quarters of the citizens in Belgium, a predominantly Roman Catholic but secular country, support granting incurably sick minors the right to die.

Opponents pointed to the difficulty of judging whether a child, in particular one with an incurable illness, has the mental capacity for making a request to die. They also argued that determining a patient’s closeness to death can be a matter of opinion.

Compared with the United States, where euthanasia is banned and physician-assisted suicide is allowed in only five states — including Washington and Oregon — Europe is relatively more permissive.

Belgium is one of a few European countries that have legalized euthanasia. The Netherlands was the first to legalize euthanasia in 2002, allowing it in special cases for seriously sick patients 12 years or older. Luxembourg allows euthanasia for adults. Switzerland allows doctors to help patients die.

But the idea of euthanizing children is considered morally repugnant in many European countries, driven in part by memories of the Nazis, who killed thousands of children they had deemed to be mentally and/or physically impaired.

In Belgium, the number of patients who have chosen euthanasia has jumped from 24 cases in 2002 to 1,342 cases in 2012, according to the commission that administers the program nationally.