McKesson, the largest drug distributor in the United States, has agreed to pay a record $150 million in fines and to suspend sales of controlled substances from four distribution centers to settle allegations that the company violated federal law, the Justice Department announced Tuesday.

The settlement is the second for the giant drug distributor. In 2008, McKesson paid a $13.25 million fine over similar allegations.

In the current case, the government accused McKesson — the fifth-largest company in the United States — of failing to design and use an effective system to detect “suspicious orders” from pharmacies for powerful painkillers such as oxycodone, as required by the Controlled Substances Act. In Colorado, for example, McKesson filled more than 1.6 million orders for controlled substances from June 2008 through May 2013, but it reported just 16 of them from a single customer as suspicious, the Justice Department said.

The company had previously acknowledged in Securities and Exchange Commission filings that it would have to pay the fine. Tuesday’s announcement adds that the company will have to employ an independent monitor to assess its compliance with the law in the future and will shutter warehouses in Colorado, Ohio, Michigan and Florida on a staggered basis for unspecified numbers of years.

In a statement on its website, McKesson said it settled “in the interest of moving beyond disagreements about whether McKesson was complying with the controlled substance regulations … and to instead focus on the company’s partnership with regulators and others to help stem the opioid epidemic in this country.”

In December, Cardinal Health, another member of the “Big Three” drug distributors, agreed to pay $44 million in penalties to resolve allegations that it failed to notify the DEA of suspicious narcotic orders.

More than 16,000 Americans died of overdoses of prescription opioids, including methadone, last year. Since 2000, the toll has been about 180,000 people.

In 2013, the DEA began investigating reports that McKesson was failing to maintain proper controls to prevent the diversion of opioids. Six years earlier, the DEA had accused it of failing to report hundreds of suspicious orders from online pharmacies. The company settled those claims, agreeing to a $13.25 million fine and promising to set up a monitoring system.

The Justice Department said in documents made public Tuesday that McKesson continued to fail to report suspicious orders between 2008 and 2012 and did not fully implement or follow the monitoring program. In 2014, federal prosecutors told McKesson it faced civil sanctions based on the results of the investigation.