PARIS (AP) — France's Parliament has approved a bill that will let doctors keep terminally ill patients sedated until death comes but stops short of legalizing euthanasia or assisted suicide.

After years of tense debate over the issue and a long journey through Parliament, the bill was passed by the country's lower house and Senate Wednesday. The text is the result of a consensus of Socialist and conservative lawmakers.

The new law will allow patients to request "deep, continuous sedation altering consciousness until death" but only when their condition is likely to lead to a quick death. Doctors will be allowed to stop life-sustaining treatments, including artificial hydration and nutrition. Sedation and painkillers will be allowed "even if they may shorten the person's life."

The bill will also apply to patients who are unable to express their will, following a process that includes consultation with family members.

The methods can involve medicating patients until they die naturally of their illness or until they starve. Some doctors, however, say it may be more human to euthanize.

"Everyone must be able to decide how to live the very last moments," Socialist lawmaker Alain Claeys, co-author of the bill, said in a speech at the National Assembly. "Our text has one purpose: fighting a 'bad dying' that still happens too often in France."

The other co-author of the bill, conservative party lawmaker Jean Leonetti, said the text aimed to tell the French: "At end of your life, if the suffering is unbearable, you'll be allowed to get to sleep, soothed and serene."

The debate over end-of-life conditions has been revived in France due to the case of Vincent Lambert, a Frenchman in a coma since a car accident eight years ago. His family is divided over whether to continue care for him.

Europe's top human rights court ruled in June that doctors could stop treatments for him. Legal proceedings are continuing in France, however, since Lambert's parents have asked for a legal representative to be designated.

The new bill will also force doctors to follow end-of-life instructions regarding terminal sedation and stopping treatments, whether they are expressed by the persons themselves or written in advance.

People can also designate a "trustworthy person" whose opinion would be predominant in case of patients that are no longer able to express their will.

The bill specifies that patients can choose to be sedated at home or in the hospital.