The prescriptions often were given to middlemen who supplied him with the names of real people, “pill-fillers,” who filled the prescriptions in exchange for money. The pills were given back to the middlemen who sold them to dealers on the underground market.

Among two dozen government witnesses this week were Melissa Hernandez, Scranage’s former office manager who said that she saw Scranage handed cash by middlemen and that she believed Scranage knew what was going on, and one of the middlemen, Anthony “Tot” Harper, who said that he paid Scranage $500 for each prescription.

Harper, 45, of DeWitt, who was indicted with Scranage, pleaded guilty to the conspiracy charge last week and testified against Scranage on Monday.

The alleged scheme was carried out from 2011 to 2015. A special agent with Virginia State Police testified that Scranage allegedly wrote more than 700 prescriptions for more than 127,000 oxycodone pills for pill-fillers and others involved in the scheme. The pills were worth millions of dollars on the street.

State police said Scranage came to their attention in 2012 when authorities received calls about his prescription practices from several pharmacies and an emergency room physician.