COLUMBUS, Ohio — Dad was dying, the doctor told James Allen’s family members as they clustered by his hospital bed.

Mr. Allen’s family was stunned. He had suffered a heart attack and was on a ventilator in the hushed intensive care unit of Mount Carmel West, a Catholic hospital in a working-class corner of Columbus. But Mr. Allen, 80, had been stabilized, his family said. He could squeeze his son’s hand. His family still believed he would return home to his bedridden wife and his backyard tomatoes.

But as the graveyard shift began that night in May 2018, the new doctor who had taken over, William Husel, said Mr. Allen was in complete organ failure, his family said. Dr. Husel offered to give Mr. Allen comfort medication and said he would “go quickly” after the family agreed to remove him from a ventilator, Mr. Allen’s daughter, Lisa Coleman, said. Then, prosecutors say, the doctor ordered up a fatally large dose of the powerful opioid fentanyl.

Now Dr. Husel is charged with killing 25 patients, including Mr. Allen, with overdoses of fentanyl, a drug that has led to tens of thousands of deaths on the streets but is also a potent, effective painkiller for critically ill patients. The prosecution is one of the largest medical-murder cases in years, and it has exposed glaring lapses that patients’ families and lawyers say allowed the deaths to continue undetected for years.