Belgium became the first country in the world to remove any age restrictions on euthanasia, after an emotional debate which split the medical profession over the best way to treat a terminally ill child with a desire to end his or her life.

Despite last-minute pleas for a rethink from within Belgium and as far away as Canada, parliament on Thursday agreed with the doctors who argued that in rare cases of unbearable and irreversible suffering, children should have the same right as an adult to ask to die with dignity.

Under the amendments to the country’s 2002 euthanasia law, a child of any age can be helped to die, but only under strict conditions. He or she must be terminally ill, close to death, and deemed to be suffering beyond any medical help. The child must be able to request euthanasia themselves and demonstrate they fully understand their choice. The request will then be assessed by teams of doctors, psychologists and other care-givers before a final decision is made with approval of the parents.

Dr. Jutte Van der Werf Ten Bosch, a pediatric oncologist from University Hospital Brussels, says such cases are very rare, but heartbreaking for families and doctors when they do come up. She recalls the frustration of treating a 16-year-old girl who was suffering severe complications from leukemia and was lying in a hospital bed connected to tubes, waiting to die.

“It was just hell for six months in the hospital,” she says. “I feel like a total failure in these cases. … You promise the child ‘I will take care of you, I will do the best I can,’ and then you can’t do the best you can because all these complications arise and you can’t do anything about it.”

She has come across children as young as eight who have articulated an understanding of their situation, but doctors expect the most likely cases would involve adolescents.

While assisted suicide is permitted under certain conditions in Switzerland, Germany and parts of the United States, only Belgium, Luxembourg and The Netherlands allow doctors to take steps to actively end a patient’s life, usually by administering an overdose of sedatives. In Luxembourg, that patient must be over 18, while in The Netherlands children can request euthanasia from the age of 12.

Belgium’s existing euthanasia law for adults has broad public support, and a recent survey by the RTBF broadcaster found that 75% of people supported extending the same rights to children. Parliament approved these amendments on Thursday with 86 MPs voting in favor, 44 against, and 12 abstentions. The Senate had already passed the bill in December.

But there has been opposition, both from religious groups and more than 170 Belgian pediatricians who signed an open letter to parliament this week requesting they delay the vote.

Dr. Stefaan Van Gool, a pediatrician at the University of Leuven, says the doctors were concerned that procedures for assessing a child’s mental capacity to make life-and-death decisions were not sufficiently clear in the bill. They were also worried a child might be pressured into making a decision by parents, and that were are too many possibilities for misuse of the law.

“We are suffering together with these children to get through the most difficult moments of life, but at such time what we deliver to these children is care,” he says, adding that his experiences show children want to live as full a life as possible right until the very end. “We have children who do exams up to two days before they die. They are children that always dream about a future, although this future may only be a few hours.”

A plea also came from Canada earlier this month, where a four-year-old girl born with a congenital heart condition recorded a video message urging Belgium’s King Philippe not to sign the law, which is the final formality. Her mother told the monarch that she was concerned that a child like her daughter—who grew up to be a happy, active child—could be euthanized after birth.

Dr. Gerlant van Berlaer, a pediatrician who also works at the University Hospital Brussels, understands why the debate in Belgium has provoked strong feelings all over the world. “I would be rather scared if it didn’t evoke emotional reactions: we’re talking about children,” he tells TIME.

But he says no doctor would ever take the decision to end a child’s life lightly. “The first reaction I will always have and all my colleagues will have is to run away from these questions because we don’t want to hear this,” he says.

He remains haunted by all the cases in which he was powerless to do anything. He cites the case of a child with Duchenne Muscular Dystrophy, where the muscles degenerate to the point where a sufferer can no longer swallow or speak. “They can see the children in the bed next to them suffocate,” he says. “They will say, ‘I know my life will end, but doctor, just don’t let it end like my friend’s did.’”

Until now, the law has not allowed him to even discuss such an option. “This child asked me not to let him suffocate,” he says. “Of course I did not do anything active at the time, but I’m still struggling with this, because I did not respond to the last question of the child.”

Contact us at letters@time.com.