Hard-luck neighborhoods bordering Miami’s Jackson Memorial Hospital regularly send locals to the emergency room. As a medical student, Dr. Hansel Tookes had a pretty good idea of which ones were on the needle.

“Here in Miami, we have a lot of career injection drug users,” said Tookes, now an assistant professor at the University of Miami. “People who have injected for 20 years.”

They were older. They were poorer. They were the usual suspects for injection-drug illnesses: skin and heart infections, hepatitis C, HIV.

Until, in late 2011, they suddenly weren’t.

That year, Tookes and his colleagues started seeing a different kind of heroin user. They were young. They had not spent years on the streets. They were new to the drug.

That, said Tookes, “is when we first knew there had been a change in the drug epidemic in South Florida.”

The doctors didn’t have to look far to find the reason — Florida’s prescription drug monitoring database, the “silver bullet” designed to take illicit prescription painkillers off the street.

“When we look back at when the line (of heroin admissions) started going up,” said Tookes, “the prescription monitoring database is the inciting event.”

With the best of intentions and the worst of plans, Florida’s long-delayed 2011 crackdown on pill mills ignited the heroin crisis, not just in Florida, but across more than half the country, a Palm Beach Post investigation found.

For years, drug users and traffickers routinely paid visits to Florida’s unregulated “pill mill” clinics. Anyone with fake pain and hard cash could walk out with a bogus prescription for painkillers.

OxyContin and other pills containing oxycodone were the drugs of choice. Palm Beach and Broward counties housed the “go-to” clinics.

Little-noticed DEA reports and federal court records show that by 2010, South Florida was a reliable oxycodone supplier to users and traffickers not only across the Southeast, but also in the Northeast, Mid-Atlantic and Great Lakes regions, an area encompassing half the United States.

And when Florida finally began shutting down its pill mill pipeline, users and addicts there did exactly what users and addicts did in Florida: They turned to heroin.

Academic studies, news reports and government agencies all have lauded the success of this state’s overdue efforts to shutter its pill mills.

None has documented — or even suggested — what The Post found: East of the Mississippi, as Florida-supplied oxycodone began disappearing, deaths tied to that and similar drugs started falling.

And simultaneously, deaths linked to heroin started rising.

It took only days or weeks after Florida’s crackdown for the pattern to emerge in some areas, as users scrambled to get their hands on a substitute opioid.

But in 2012, the first year the crackdown was in full effect, every region formerly on the receiving end of the pill mill pipeline recorded some version of the deadly shift as heroin replaced suddenly scarce Florida pills. To trace oxycodone deaths, The Post used federal numbers that grouped oxycodone with several similar opioids.