SALT LAKE CITY — A Brigham City pill doctor convicted of illegally prescribing painkillers to patients, including one who died, will now serve only three years in prison.

U.S. District Judge Dee Benson on Monday upheld his decision earlier this year to cut Dewey C. MacKay's sentence from 20 years to three years. Prosecutors objected to Benson's order in May and requested a hearing that was held Monday.

The judge originally sentenced MacKay, 66, after a jury convicted him of 37 counts of illegally dispensing painkillers — including two that resulted in the death of 55-year-old David Wirick — and three counts of using a communication device in a drug trafficking offense in December 2011. Jurors acquitted him of 44 other counts.

Benson wrestled with the original 20-year sentence and reluctantly imposed it under federal minimum-mandatory guidelines.

A U.S. Supreme Court ruling in January held that in cases where the use of the drug distributed by the defendant is not an independently sufficient cause of death, the sentencing guidelines do not apply. MacKay's attorney argued that there was no evidence that Wirick's death resulted from the either the oxycodone or hydrocodone MacKay prescribed.

MacKay, who has serious health problems, has been in prison since May 2012.