FILE - This Feb. 19, 2013, file photo, shows OxyContin pills arranged for a photo at a pharmacy in Montpelier, Vermont.
FILE - This Feb. 19, 2013, file photo, shows OxyContin pills arranged for a photo at a pharmacy in Montpelier, Vermont.

A Virginia doctor who prosecutors said ran his medical practice like an interstate drug distribution ring was sentenced Wednesday to 40 years in prison for illegally prescribing opioids.

Dr. Joel Smithers of Greensboro, North Carolina, was sentenced in U.S. District Court in Abingdon.

This undated photo provided by the Southwest Virginia Regional Jail Authority shows Dr. Joel Smithers.

Executive Assistant U.S. Attorney Laura Day Rottenborn said Judge James Jones sentenced Smithers to 40 years. He faced a mandatory minimum sentence of 20 years and a maximum of life.

Smithers was convicted in May of more than 800 counts of illegally distributing opioids, including oxycodone and oxymorphone that caused the death of a West Virginia woman.

Authorities say Smithers prescribed more than 500,000 doses of opioids to patients from Virginia, Kentucky, West Virginia, Ohio and Tennessee while based in Martinsville, Virginia, from 2015 to 2017.

Smithers, 36, a married father of five, testified that he was a caring doctor who was deceived by some of his patients.

Some patients remained fiercely loyal to him, testifying that they needed the powerful opioids he prescribed for them to cope with chronic pain.

Smithers wrote in a court filing that he plans to appeal his convictions.