From the beginning, the U.S. government’s decade-long crackdown on prescription drug abuse has run an unsettling risk: that arresting doctors and shuttering “pill mills” would inadvertently fuel a new epidemic of heroin use.

State and federal officials have pressed their campaign against prescription drug abuse with urgency, trying to contain a scourge that kills more than 16,000 people each year. The crackdown has helped reduce the illegal use of some medications and raised awareness of their dangers.

But at the same time that some pain medications have become less available on the street and pricier, many users have switched to cheaper heroin, since prescription pills and heroin are in the same class of drugs and provide a comparable, euphoric high.

With the nationwide heroin problem gaining greater attention after the recent death of actor Philip Seymour Hoffman from heroin and other drugs, experts on addiction say the government’s actions contributed to the problem it is now confronting. The war on drugs, they say, is an unwieldy conflict where targeting one illicit substance can be an unintentional boon to another.

“Absolutely, much of the heroin use you’re seeing now is due in large part to making prescription opioids a lot less accessible,’’ said Theodore Cicero, a psychiatry professor at Washington University in St. Louis. He co-authored a 2012 study, cited in the New England Journal of Medicine, that found that a reformulation of OxyContin to make it harder to abuse caused heroin use to nearly double.

Although policymakers “did the best they could at the time” in fighting prescription drugs, Cicero said, “there were signs years ago that this was going to happen, and there was just a lot of inaction.” He said the government could have acted sooner to mitigate heroin’s toll, such as by promoting the use of medicines to fight overdoses and ease withdrawal symptoms.

The government itself predicted that targeting prescription drugs could give heroin use an unintended lift. The Justice Department’s drug intelligence arm in 2002 highlighted the potential consequences: “As initiatives taken to curb the abuse of OxyContin are successfully implemented, abusers of OxyContin . . . also may begin to use heroin, especially if it is readily available, pure, and relatively inexpensive.’’

A long-emerging trend

Yet those projections did not factor into discussions by top drug policy officials, even after numerous government reports and congressional testimony indicated that the shift to heroin was happening, according to current and former federal officials. Heroin use began to rise at the end of the Bush administration and has surged in the Obama years.

John Walters, who ran the Office of National Drug Control Policy as President George W. Bush’s “drug czar,’’ said he doesn’t recall “anyone raising’” the prescription drugs-heroin link, though the reports warning of the link were screened by people in his office. “The heroin problem was getting better, and the real issue was the growth of pharmaceuticals,” he said.

Gil Kerlikowske, who took over as President Obama’s drug czar in 2009, said the connection between prescription drugs and heroin “was not on the radar screen” during most of Obama’s first term and that he “didn’t do everything I should have” to raise awareness of the growing heroin problem. Now, he said, heroin is a “much larger concern.”

Between 2007 and 2012, heroin use rose 79 percent nationwide, according to federal data. Within the same period, the data show, 81 percent of first-time heroin users had previously abused prescription drugs.

The likelihood that many prescription-drug abusers will switch to heroin because it is much cheaper is widely accepted among addiction treatment professionals and law enforcement officials.

Justice Department officials reject any direct linkage between the crackdown on prescription drugs and rising heroin use, although it was a Justice Department unit — the National Drug Intelligence Center — that warned that the campaign against illegal use of prescription drugs was fueling heroin use. The center, which closed in 2012, was separate from the unit employing prosecutors and agents who fight drug use.

Moreover, these officials defended their fight against prescription drug abuse, saying those efforts prevented numerous overdose deaths. Even with heroin use on the rise, they said in interviews, it still represents a much smaller problem than prescription medications. Heroin kills about 3,000 people a year, less than a fifth of the toll from prescription drug abuse, government data show.

Connection disputed

Joseph T. Rannazzisi, who runs the Drug Enforcement Administration’s Office of Diversion Control, denied that the spike in arrests for prescription drug misuse has affected their cost and driven users to heroin, saying street prices have been generally stable. “I don’t think one thing has anything to do with the other,’’ said Rannazzisi, who emphasized that the move against prescription pills saved many lives. The DEA is part of the Justice Department.

Tristram J. Coffin, the U.S. attorney for Vermont, who has been a leader in the battle against prescription drug abuse, also remains a staunch defender of that campaign. “Prescription drugs are incredibly addictive, incredibly lethal, and we had to deal with them,’’ he said.

But Coffin acknowledged that the crackdown made some doctors reluctant to write prescriptions for pain medications. “That in turn causes people, because they have an opioid dependency, to turn to heroin,’’ he said.

In 2010, Justice Department officials told The Washington Post that a federal probe of prescription drug abuse in Northern Virginia, the nation’s largest such investigation at the time, had caused black market OxyContin prices to nearly double. Police and addiction treatment professionals in three states said last week that actions such as closures of “pill mills” that dispensed massive amounts of pharmaceuticals had made them harder to get, raising their price as demand outpaced supply.

Still, “I can’t recall anyone at any point having a plan that would have limited the shift from prescription drugs to heroin,’’ said Marvin D. Seppala, chief medical officer at the Hazelden Betty Ford Foundation, a network of drug treatment centers.

Warnings of heroin use

It was without controversy that the Food and Drug Administration approved OxyContin in 1995. The powerful drug was a godsend for millions of pain sufferers.

Within a few years, however, authorities learned that addicts were crushing the time-release tablets and snorting or injecting them, leading to property crimes and overdose deaths.

A crackdown began at the end of the Bill Clinton administration and escalated under the George W. Bush administration, which dispatched anti-drug agents and encouraged state monitoring programs that detect suspicious prescriptions. Federal arrests for illegal use of prescription drugs skyrocketed more than 900 percent between 2001 and 2007, according to the National Drug Intelligence Center.

During the same period, federal heroin arrests fell 32 percent as heroin use was generally stable and even declined among adolescents, said the center’s reports, which cited DEA arrest data.

Bush administration officials said they targeted the more pressing threat. “Oxy was extremely accessible,’’ said Paul J. McNulty, a former U.S. attorney in Alexandria and deputy attorney general. “At the same time, many of us involved in drug policy from the 1980s onward saw heroin on the decline for a long period.”

Throughout the Bush administration and afterward, nearly every year between 2002 and 2011, the Justice Department’s drug intelligence arm warned that the crackdown could drive drug abusers to heroin.

As early as 2003, the center said, some Oxy users were already making the switch. “Not only is heroin less expensive, but efforts to control the diversion of OxyContin may be reducing the availability of OxyContin in some areas,’’ it wrote that year. The concerns were echoed in congressional testimony starting in 2008, transcripts show.

Michael F. Walther, the drug center’s former director, said the reports were read in advance by officials at the DEA and the Office of National Drug Control Policy.

“It never crossed anyone’s mind that cracking down on Oxy would lead to an increase in heroin,’’ said one current federal official involved in anti-drug enforcement, who spoke on the condition of anonymity to discuss internal deliberations.

A new focus on heroin

When President Obama took office, his administration also tackled the epidemic in front of it. “Prescription drugs were much more of a priority” than heroin, said Timothy Condon, who was a senior science policy adviser in the the Office of National Drug Control Policy in 2010 and 2011.

As heroin use rose in recent years, the government began reacting. Since 2009, the DEA has widely circulated a slide called “circle of addiction” that shows the linkage between pain medications and heroin.

Heroin trafficking cases rose 52 percent between 2008 and 2012, federal data show. And the drug czar’s office, which has publicly warned about the link between prescription drugs and heroin for the past several years, has begun a number of anti-heroin initiatives. The administration supports the use of naloxone, an anti-overdose medicine, and drugs such as methadone that help ease heroin withdrawal.

There’s no missing the toll of heroin any more.

“Heroin is taking up a lot more of our attention and time,’’ said Kerlikowske, who said other measures targeting heroin are in the works.

Experts praised the recent steps but said they should have come much earlier. “The intent was good, but someone, somewhere, should have thought it through to say ‘now we’re going to have a flood of heroin overdoses,’ ’’ said Jim Takacs, executive director of the Licking County Alcoholism Prevention Program near Columbus, Ohio. He said the state’s recent crackdown on pill mills has driven the price of prescription medications “way up” and caused heroin abuse to spike.

“They should have known,’’ Takacs said.