(CNN) A Virginia doctor convicted in May of illegally prescribing more than half a million opioid tablets was sentenced Wednesday to 40 years in a federal prison, according to a federal court in Virginia.

Joel Smithers, who was convicted of 859 counts of illegally prescribing drugs, had faced between 20 years and life in prison, the US Department of Justice said in a news release

Smithers was sentenced to 480 months in prison in US District Court for the Western District of Virginia in Abingdon, where he was also given a supervised release of three years and ordered to pay a special assessment of $86,000, according to the clerk. He was remanded and is currently in custody, the clerk said.

Smithers prescribed more than 500,000 opioid tablets in 19 months before federal agents arrived at his Martinsville office in March 2017 with a search warrant, prosecutors said.

A woman from West Virginia died after Smithers prescribed her oxycodone and oxymorphone, the Justice Department said. The jury found the prescriptions caused her death.