Exclusive data show how individual counties moved through the three waves of the opioid crisis: prescription pills, heroin and fentanyl.

In Berkeley County, W.Wa., for example, the trend mirrored national ones. Prescription pain pills were the main cause of overdose deaths through 2011. By 2013, drug users turned to heroin, which set the stage for fentanyl.

In Washington, D.C., one of the hardest-hit regions, overdose deaths were primarily driven by heroin until 2016 when it shifted to fentanyl.

But in Duval County, Fla., where the largest city is Jacksonville, prescription pain pills remained the primary cause of opiate deaths until 2016. Fentanyl would eclipse pills the following year.

The opioid epidemic has been a major driver of declining U.S. life expectancy. Although communities have experienced the crisis differently, a deeper look at the broad trends of the three waves shows how each drug — pills, heroin and then fentanyl — prepared the way for the next.

The Washington Post used an exclusive research agreement with the Centers for Disease Control and Prevention to acquire incident-level death data to examine the predominant killers of citizens county by county, year by year.

Rather than telling the story of the epidemic through death rates, as others have done, the analysis illustrates how the citizens in these counties rapidly shifted their drug use as the opioid epidemic got worse.

By 2011, more than 12 billion oxycodone and hydrocodone pills were being shipped to pharmacies across the country — the high point for shipments — and prescription pills were the predominant killers of opioid users in much of the nation.

Over the next several years, shipments slowly declined as a crackdown on illegal diversion, begun in 2006, started to have an effect on overall usage patterns. And in certain areas of the country, especially along the East Coast, drug users rapidly began dying from other opioids at higher levels.

In 2011, pill deaths had risen to nearly 16,000 annually, more than three times the number from a decade earlier. The shipments and deaths were highest in a virtual opioid belt that stretched through West Virginia, southwestern Virginia and Kentucky.

This swath includes 18 of the top 20 counties in per capita opioid deaths nationwide and 12 of the top 20 counties in per capita pill distribution. From 2006 through 2012, death rates in the belt were 4.5 times the national average.

Katie Allison's son, Henry Granju, started abusing opioid pills in 2008 when he was 16 in Knoxville, Tenn. At first, many of the pills were stolen from parents' medicine cabinets. Eventually, he and many of his friends became addicted.

"It was like a fire hose of illegally diverted prescription medication," said Allison, 52. "It hit this community while we weren't even looking. It hit us like the plague."

After the DEA crackdown, prescription opioids became harder to come by. For Granju and many like him who were already addicted, that simply meant they began looking to purchase theirs on the street. He pawned his prized possession, his guitar, to pay for pills.

In 2010, Granju fatally overdosed on opioid pills, one week before he was set to graduate high school. He was 18.

The first wave of the opioid epidemic was primarily of prescription pills. The second was heroin. From 2011 to 2014, as deaths from prescription pills plateaued, deaths from heroin more than doubled.

The heroin death rate never surpassed that of prescription pills, but it served as a transition into the illegal market for many already addicted to pills. There, they would find an even deadlier drug awaiting them.

Fentanyl has been used in the U.S. for decades. The drug, an opioid 50 times more powerful than heroin, had been given primarily to patients in excruciating pain.

Starting in 2013, it began to flow into the country illegally in unprecedented quantities, the vast majority of it from China. It found its way into the hands of drug users primarily by being cut with heroin.

Software executive Timothy Allan Mauldin, 36, had been secretly ordering fentanyl off the dark web for about three months when he overdosed. His wife, Lauren, 35, had little reason to think the opioid crisis was part of her life.

"We had West Elm furniture, cute dogs and jobs in the tech industry," she said.

After she watched paramedics revive him with naloxone, a drug that counters overdoses, she learned the truth. He promised Lauren he would stop. She believed him.

He was "the smartest person I've ever known," she said. "Every time he made a promise, he never let me down."

A week later, on June 18, 2015, Timothy took butyrfentanyl, a variant of the drug. This time, it was lethal.

From 2013 to 2017, fentanyl overdose deaths rose nearly tenfold to 28,869. Ohio, the center of the heroin crisis, became a center of the fentanyl epidemic. So did West Virginia, which was at the heart of both previous waves.

Federal agencies were overwhelmed by fentanyl, and so were first responders.

Firefighter and paramedic Andrew Morrow in Biddeford, Maine, had been to hundreds of overdose scenes. On Jan. 23, 2017, he found his daughter, Amber Pearl Morrow. "It didn't feel like it was real," he said.

She and a friend had taken what they thought was cocaine. It was pure fentanyl. Amber was 21.

While many resources are going toward stemming the tide of fentanyl deaths, some experts are pointing to a budding fourth wave. It does not involve another opioid. Instead, there is mounting concern about an older menace that is increasingly getting cut with heroin and fentanyl: methamphetamine.

"Meth and cocaine are making a comeback and they are more potent than they were during the last wave," Mark Stringer, director of Missouri's Department of Mental Health, told the Associated Press. "Where meth is much more prevalent than opioids, this will be a game-changer."

Federal oficials have responded by broadening a $1.5 billion grant program previously restricted to the opioid crisis to also counter methamphetamine and cocaine.

"I know the term 'opioid crisis' is used a lot," said White House drug czar James W. Carroll. "I say what we really have is an addiction crisis."