BUFFALO, N.Y. (AP) — A 166-count federal indictment accuses a western New York doctor of illegally prescribing pain medication that resulted in six deaths.

The U.S. Attorney's office in Buffalo says Wednesday that Dr. Eugene Gosy (GOH-see) of Clarence was responsible for the mass distribution of prescription painkillers including fentanyl and oxycodone.

Investigators say the pain management doctor ignored obvious red flags that his patients were addicted and abusing their medications.

Conviction on the charges connected to patient deaths could bring a maximum sentence of life in prison.

Law firm Colucci and Gallaher released a statement saying Gosy has helped tens of thousands of patients and his rate of patient overdose death is far below the national average.

Gosy was already facing an April 2016 indictment alleging illegal prescribing and health care fraud.