A bottle of prescription oxycodone pills. (Mark Lennihan/AP)

Federal prosecutors filed criminal charges against a major drug distributor and two of its former executives Tuesday, a new tactic that for the first time exposes wholesalers of legal painkillers to potential prison sentences for their roles in the nation’s opioid epidemic.

The company, Rochester Drug Cooperative, and the executives were charged with three crimes, including conspiracy to distribute controlled narcotics for nonmedical reasons. The two men could face 10 years to life in prison on that charge.

The company and one of the executives, former operations manager William Pietruszewski, did not dispute the charges, which include supplying “tens of millions” of pills to drugstores from 2012 to 2017 that were used for illegal purposes. Pietruszewski agreed to plead guilty and cooperate with prosecutors, according to documents released Tuesday by federal authorities in Manhattan.

The company’s former chief executive, Laurence F. Doud, who retired in 2017, was indicted and was scheduled to appear in federal court Tuesday. The company agreed to pay a $20 million fine over five years, and the U.S. Attorney’s Office for the Southern District of New York deferred prosecution of it.

The charges against the country’s sixth-largest drug wholesaler are sure to send a shudder through the small group of firms that control narcotics distribution in the United States. To date, prosecutors and the Drug Enforcement Administration have used only civil penalties against these middlemen in their effort to force the companies to report and block suspicious orders of painkillers by pharmacies.

“This prosecution is the first of its kind: Executives of a pharmaceutical distributor and the distributor itself have been charged with drug trafficking — trafficking the same drugs that are fueling the opioid epidemic that is ravaging this country,” said U.S. Attorney Geoffrey S. Berman.

Jeff Eller, a spokesman for the company, said in a news release that “we made mistakes, and RDC understands that these mistakes, directed by former management, have serious consequences.”

Eller noted that a new management team, installed in April 2017, has substantially beefed up its monitoring of drug flow. The company’s compliance department will spend $1.7 million this fiscal year, up from an average of $150,000 annually from fiscal 2013 to 2016, Eller said.

A lawyer for Doud said he would contest the charges. “Mr. Doud is being framed. The government has it all wrong and is being used by others to cover up their wrongdoing,” Robert C. Gottlieb said in a written statement. “Mr. Doud will fight these false charges to his last breath and he will be vindicated.”

Pietruszewski’s attorney, William J. Hughes, declined to comment.

The flood of legal painkillers that washed across the United States beginning in the late 1990s is widely considered the beginning of the opioid epidemic, which in recent years has been driven more by heroin and illegal fentanyl manufactured primarily in China.

More than 400,000 people have died of opioid overdoses between 1999 and 2017 in the largest drug crisis in U.S. history.

A small division of the DEA has waged a 13-year war against some of the legal opioid distributors, using civil penalties to punish them for allowing hundreds of millions of pills to end up in the hands of users and dealers. Distributors are responsible for monitoring and reporting any unusual amount, pattern or frequency of orders by drugstores — signs that drugs are being diverted to the black market.

Hundreds of cities, counties, states and Native American tribes also have filed lawsuits against distributors, demanding compensation for the costs of contending with the drug crisis on their streets.

In an early criminal case, federal charges were brought against Purdue Pharma, manufacturer of OxyContin. The company and three of its executives pleaded guilty in 2007 to misleading the public, doctors and regulators about the drug’s addictive qualities and paid a total of $634 million in fines.

Three enormous companies — McKesson, Cardinal Health and AmerisourceBergen — control nearly 90 percent of U.S. drug distribution. All have settled cases with the DEA since 2007, including an agreement that resulted in a $150 million fine against McKesson, the sixth-largest U.S. company on the 2018 Fortune 500 list.

The Washington Post and “60 Minutes” have reported that, after paying fines, some distributors returned to ignoring the law. In the McKesson case, DEA investigators wanted to crack down on that behavior by bringing criminal charges for violations across the country, but federal prosecutors declined, reporting by The Post and “60 Minutes” revealed.

Now, in what could become a test of the criminal approach, the prosecutors outlined egregious behavior by Rochester Drug Cooperative and its executives, likening them to drug traffickers. They said the company supplied “tens of millions” of doses of oxycodone and pharmaceutical fentanyl to customers who managers knew were not using them for legitimate pain relief.

“For at least half a decade, RDC distributed dangerous, highly addictive opioids to pharmacy customers that its senior management, including Laurence F. Doud, the defendant, knew were being sold and used illicitly,” according to the grand jury indictment of Doud.

Doud and other managers were accused of making a “deliberate decision not to investigate, monitor or report to the DEA pharmacy customers that they knew were diverting controlled substances for illegitimate use.” Of nearly 3,000 flagged orders for oxycodone and fentanyl, the company reported four to the DEA, according to the indictment.

Despite repeated concerns from other employees, the indictment alleges, Doud continued to direct that drug orders go to one unnamed pharmacy whose orders of oxycodone and fentanyl spray “grew exponentially.” In part, that was because the pharmacy was Rochester Drug Cooperative’s best customer and Doud received “a substantial bonus” based on the company’s earnings, according to the indictment.

At another pharmacy, more than 60 percent of customers paid in cash, and nearly all of them were coming to the pharmacy from out of state — red flags for illegal drug activity. An auditor described the situation in an email as a “DEA investigation in the making.”

Doud replied: “I don’t think this is going to end well.”