The justices ruled 9-0 in favor of Xiulu Ruan and Shakeel Kahn, who had argued in appealing their convictions that their trials were unfair because jurors were not required to consider whether the two physicians had "good faith" reasons to believe their numerous opioid prescriptions were medically valid.
Liberal Justice Stephen Breyer, writing for the court, said that once defendants produce evidence that they were authorized to dispense controlled substances like opioids, prosecutors must prove they knew they were acting in an unauthorized manner.
The justices sent the two cases back to federal appeals courts that had previously upheld their convictions for further proceedings, where prosecutors may argue that any mistakes in their jury instructions amounted to harmless errors.
The United States for more than two decades has struggled with an opioid epidemic that, according to federal health officials, has claimed the lives of more than a half million Americans.
States have sued drug companies and pharmacies to hold them liable, but another key element in the public health crisis has been the role of doctors in prescribing massive volumes of the highly addictive pain medication.
Some doctors have been accused of turning their medical practices into "pill mills" - routinely prescribing controlled substances without a medical necessity and outside the bounds of a normal professional practice.
There have been divisions in lower courts about the standard under which doctors can be convicted of violating a federal law called the Controlled Substances Act, which regulates numerous substances including painkillers like opioids, for writing prescriptions outside the bounds of professional practice.
Ruan, who practiced in Alabama, and Kahn, who practiced in Arizona and then Wyoming, were sentenced to 21 and 25 years in prison, respectively, in separate criminal cases.
Prosecutors said Ruan with a business partner ran a clinic in Mobile that issued nearly 300,000 controlled-substance prescriptions from 2011 to 2015 and was one of the top U.S. prescribers of certain fentanyl-based pain medications.
Prosecutors said he accepted kickbacks from drugmaker Insys Therapeutics Inc to prescribe a fentanyl spray to patients. Insys' founder, John Kapoor, was later convicted of conspiring to bribe doctors including Ruan to prescribe the drug and defraud insurers into paying for it.
Prosecutors said Kahn regularly sold prescriptions for cash and unlawfully prescribed large amounts of opioid pills, resulting in at least one patient dying of an overdose.