PARIS — At least seven times, alone and in secret, Dr. Nicolas Bonnemaison prepared a lethal dose of sedative and quietly ended the life of a comatose patient in his care.

Dr. Bonnemaison, an emergency physician and palliative specialist in the city of Bayonne in southwestern France, acted without consultation of any kind — with other doctors, nurses or his dying patients’ families — and sought to conceal the procedures, keeping them unrecorded. All this he admitted freely in court, saying he was moved by a sense of duty to act outside the law, to spare his colleagues and his patients’ loved ones the strain of so weighty a choice. He was charged with the poisoning deaths of seven people.

“You wanted to protect everyone — the patients, the families, the medical personnel — out of compassion,” a state prosecutor told Dr. Bonnemaison. “To be too compassionate is to deem others disposable. It is to unburden them of a responsibility that, in fact, belongs to them.”

“I acted as a doctor,” Dr. Bonnemaison told the court in June, “through to the very end.”

A jury acquitted him. The courtroom, filled with his supporters, erupted in applause.