Billions of painkillers flooded communities across the United States, including Brockton, according to recent data obtained by the Washington Post.

Drug manufacturers shipped more than 40 million pain pills to Brockton in a six-year period.

The pills made their way to the City of Champions through pharmacies, distributors, and physicians between 2006 and 2012.

For the first time ever, the public can see details of who manufactured pain pills and which pharmacies stocked them, revealing exactly what drug companies knew as they flooded communities with opioids that fueled a national epidemic.

After a yearlong court battle, The Washington Post and HD Media, which owns the Charleston Gazette-Mail, won public access to a key Drug Enforcement Administration database in July.

The database, which The Washington Post released publicly last week, details 380 million times between 2006 and 2012 that manufacturers sold opioids to pharmacies, physicians or other distributors — including shipments of more than 1.3 billion pills to Massachusetts alone.

The Washington Post narrowed the data to oxycodone and hydrocodone pills because research has shown those common prescriptions were the painkillers most often diverted into the black market.

In 2006, 4.44 million pills went to companies in Brockton. Shipments grew each year and reached 6.31 million in 2012 — a 42.2 percent increase overall, according to the data.

For Plymouth County, 12.7 million pain pills were sent to pharmacies and physicians in 2006 and the shipments grew each year after that, reaching 17.1 million in 2012, a GateHouse Media analysis of the data show. Bristol County was shipped 15.7 million pills in 2006 and 21.1 million in 2012. Norfolk County’s tally grew more slowly, from 14.1 million in 2006 to 16.3 million in 2012.

Differences emerge after accounting for population over that seven-year stretch. Annual shipments averaged out to 35 pills per person in Bristol County, 32 in Plymouth and 23 in Norfolk. All but two counties in the state — Hampden and Dukes — were below the national average of 36 pills per person each year.

The top 10 counties in the United States all saw annual rates of more than 155 pills per person.

Companies that received the most pain pill shipments in Brockton between 2006 and 2012 were PharMerica, a pharmacy management service headquartered in Kentucky; CVS Pharmacy, which has seven locations in the city; and Walgreen Eastern Co., a subsidiary of Walgreens Co.

Drug manufacturers shipped a total of 13.89 million pills to PharMerica in Brockton, which accounts for 34 percent of the pills sent to the city between 2006 and 2012, the data shows.

The company had the second highest number of pills in the state during this time period behind Injured Workers Pharmacy in Andover, which received 34.27 million pills.

Barnard Baker, a company spokesman, said PharMerica works with assisted living and skilled nursing facilities. Many of its patients are seniors who sometimes take multiple prescriptions, he said.

In Brockton, CVS received 13.21 million pills — nearly a third of the total shipped to the city in the six-year period, according to the data.

Mike DeAngelis, senior director of corporate communications, said the company's pharmacies are close to several hospitals whose physicians write prescriptions for patients experiencing pain.

"We maintain stringent policies, procedures and tools to help ensure that our pharmacists properly exercise their professional responsibility to evaluate controlled substance prescriptions before filling them," he said in a statement. "While we have taken numerous actions to strengthen our existing safeguards to help address the nation’s opioid epidemic, it is important to keep in mind that doctors have the primary responsibility to make sure the opioid prescriptions they write are for a legitimate purpose."

Walgreen Eastern Co. had 6.88 million pain pills total shipped to Brockton.

The company hasn't distributed prescription controlled substances since 2014 and before that it only distributed to its chain of pharmacies, a Walgreens spokesman said.

"Walgreens pharmacists are highly trained professionals committed to dispensing legitimate prescriptions that meet the needs of our patients," the company said in a statement. "Walgreens has been an industry leader in combating this crisis in the communities where our pharmacists live and work."

Other pharmacy distributing companies, including ones that work with supermarkets or health care providers, received pain pills from drug manufacturing companies.

Chain and retail pharmacies account for a majority of the companies in Brockton that received pain pills from drug manufacturers. Medical practitioners including physicians, a dentist, and a veterinarian received about 3,700 pills between 2006 and 2012, which is less than .01 percent of the pills in the city during that period.

The government and drug industry opposed the release of the Drug Enforcement Agency data and won the initial court case to block it, but the news organizations prevailed on appeal.

The media groups also convinced the court to unseal depositions and internal documents, such as emails, that show companies’ internal push to increase sales even while opioid-related deaths soared.

Nationally, about 144,000 people died from opioid overdoses between 2006 and 2012 — including 2,992 people in Massachusetts — according to data from the Centers for Disease Control and Prevention. An additional 211,000 people — of whom 8,727 were in Massachusetts— died in the five years since then.

The death rate here has long outpaced the nation but has more than tripled in the last decade, going from 9.1 fatal opioid overdoses per 100,000 people in 2008 to 28.2 deaths per 100,000 in 2017.

Yet, that is almost half the death rate seen in West Virginia, which went from having one of the nation’s lowest rates to its highest because of the epidemic.

Lawsuits related to drug companies’ role in those deaths already are the largest in American history with settlements surpassing those made with tobacco companies in the 1980s.

Some of the largest drug companies already have paid more than $1 billion in federal fines and even more to states and counties who sued. Exact deals remain to be reached with most filers.

But at least one pharmaceutical trade association executive appeared to blame the federal Drug Enforcement Association for the epidemic.

“The DEA has been the only entity to have all of this data at their fingertips, and it could have used the information to consistently monitor the supply of opioids and when appropriate, proactively identify bad actors,” said John Parker, senior vice president of the Healthcare Distribution Alliance, in an email to GateHouse Media.

Healthcare Distribution Alliance is the national trade association representing pharmaceutical distributors. Parker emphasized that HDA members followed rules requiring them to report sales to federal officials.

“Unlike the DEA,” Parker said, “distributors have no authority to stop physicians from writing prescriptions, nor can they take unilateral action to halt pharmacies’ ability to dispense medication.”

The Post reported that oxycodone and hydrocodone pills accounted for three-quarters of all opioid shipments to pharmacies over the seven years of tracking. The newspaper released the original data, as well as an easy-to-use search tool, writing that they want “to help the public understand the impact of years of prescription pill shipments on their communities.”

Communities have long known the tally of resulting overdose deaths. But until now, Americans could not know how many pain killers had been sent to their communities because public officials and drug company attorneys sought to keep the information secret.

The deaths came in three waves.

Manufacturers saturated towns with more painkillers than reasonably could be used for medical purposes and so the pills were diverted to the black market and abused. When access to medical-grade opioids was cut off amid crackdowns and public pressure, people had to switch to street opioids, like heroin, to prevent debilitating withdrawal.

People died.

Overdoses spiked even more as Mexican cartels began mixing often-tainted Chinese fentanyl into heroin and then began selling that powerful opioid on its own.

Court documents show that companies ran marketing campaigns with distorted facts about painkillers' effectiveness and aggressively pushed for increased sales even when they knew more pills were being sold than could legally be used. At least one executive was criminally convicted for trying to bribe doctors to increase pain killer sales.

Internal documents freed as part of the Washington Post’s legal case and shared with the public by the newspaper show that many high-level company officials focused on following the letter of reporting laws but did not see themselves as having a broader duty to halt suspicious sales even as overdose deaths grew.

One of the nation’s largest distributors said as much in an August 2018 court deposition.

“Cardinal Health does not have an obligation to the general public,” said Vice President Jennifer Norris when asked about the opioid epidemic. “Cardinal Health has an obligation to perform its duties in accordance with the law, the statute, regulations, and guidance.”

An email exchange a decade earlier illustrates the sales-at-any-cost attitude prevalent throughout the documents newly unsealed by the court.

In January 2009, a national account manager for Mallinckrodt told a vice president of KeySource Medical that he had just shipped the company 1,200 bottles of 30mg oxycodone tablets. That particular dosage is preferred by many illicit users and drug traffickers.

“Keep ’em comin’!” said Steve Cochrane of KeySource. “Flyin’ out of there. It’s like people are addicted to these things or something. Oh, wait, people are. . .”

Victor Borelli, from Mallinckrodt, replied: “Just like Doritos keep eating, we’ll make more.”

A company spokesperson emailed GateHouse Media this week to condemn Borelli’s comments.

“This is an outrageously callous email from an individual who has not been employed by the company for many years. It is antithetical to everything that Mallinckrodt stands for and has done to combat opioid abuse and misuse.”

Borelli’s LinkedIn profile shows he left the company in 2012, three years after his Doritos comment, to join Dr. Reddy’s Laboratories, leaving there in June 2017 as Vice President of Sales. He lists his current employment as Vice President of Sales for Edenbridge Pharmaceuticals.

Enterprise staff writer Mina Corpuz can be reached at mcorpuz@enterprisenews.com. Jayme Fraser can be reached at jfraser@gatehousemedia.com