When the FDA took steps this month to put limits on opioid cough medicine for children, it was the latest sign of an agency crackdown on a class of painkillers that has taken thousands upon thousands of American lives.

A crackdown, critics say, that has been far too long coming.

Pharmaceutical companies, doctors and clinics, and even the DEA have come under fire in what many say is the worst public health crisis in modern U.S. history. But some experts think it was the FDA, the federal gatekeeper for prescription medication, that could have prevented it.

"I think this may be the best example in history of a regulatory agency failure leading to a public health catastrophe," said Dr. Andrew Kolodny, co-director of opioid policy research at Brandeis University's Heller School for Social Policy and a frequent FDA critic.

The FDA says it has taken "significant steps to confront the staggering human and economic toll created by opioid abuse and addiction, including strengthening drug warnings, taking action against companies for misleading promotion and taking important measures to enhance the safe and appropriate use."

But from the 1995 approval of Oxycontin to belated 2013 restrictions on popular painkillers like Vicodin, Kolodny and others say the FDA has squandered one opportunity after another to curb rampant prescribing and the wave of addiction that followed.

West Virginia Sen. Joe Manchin, whose state has the highest opioid death rate in the nation, sums up the FDA's lumbering response in two words: "Absolutely criminal."

Read the FDA's full statement on its response to the opioid epidemic

The FDA's new commissioner, Dr. Scott Gottlieb, doesn't go that far. But he acknowledges that the agency, where he was a deputy from 2005 to 2007, did not do all it could.

The 1995 approval of OxyContin led to what many see as the biggest public health catastrophe in the nation. George Frey / Reuters

"I don't know that we could have stopped it," said Gottlieb, who has made opioids the top priority of his seven-month tenure, in an interview with NBC News.

"I think that there were opportunities probably years ago to take steps that might have allowed us to get ahead of it more than we are now. I think a lot of people didn't do what they needed to do in the past or we wouldn't be in the situation we're in right now."

The situation is undeniably grim: more than 300,000 deaths from prescription and illegal opioids since 2000, a drug-dependent baby born every 25 minutes, and life expectancy in the U.S. down for the second year in a row.

For more NBC coverage of the opioid crisis, click here

The stage was set in the 1990s when there was a shift by some in the medical community to view chronic pain as treatable.

"I think doctors were trained to prescribe opioids for the treatment of pain," said Gottlieb, who finished his internal medicine training in 1999.

"I think a lot of people didn't do what they needed to do in the past or we wouldn't be in the situation we're in right now."

"I think there was a perception that some of the newer drugs weren't as addictive as some of the older formulations," he added.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"In many cases we were wrong."

When the FDA approved controlled-release Oxycontin, the label said "delayed absorption as provided by OxyContin tablets is believed to reduce the abuse liability of a drug" and that addiction to opioids used for legitimate pain management was "very rare."

That approval paved the way for the manufacturer, Purdue Pharma, to aggressively market Oxycontin for moderate, chronic pain. More than a decade later, the company would pay a $600 million fine and admit that when it promoted Oxycontin as less addictive than other painkillers, it knew it wasn't true.

Read Purdue's statement on opioids

It wasn't until 2001 that the FDA added stronger warnings to the Oxycontin label and narrowed the circumstances under which it should be prescribed.

By then, a growing number of Americans were hooked on Oxycontin, with some turning to heroin. At a Congressional hearing that year, law enforcement officials in the region hardest hit by "hillbilly heroin" — West Virginia and surrounding states — said they were in the grips of an epidemic.

Dr. Andrew Kolodny is a critic of the FDA's handling of opioids. NBC News

In Kolodny's view, the FDA had a chance to reverse course the very next year when it convened a meeting of experts to discuss opioids.

"They could have changed the rules so that we wouldn't get a steady stream of new opioids hitting the market — each one pouring fuel on a fire," Kolodny said.

But any hope of major reform died with the makeup of the 2002 group, Kolodny said. Eight of 10 invited guest speakers had ties to the pharmaceutical industry.

"It was very clear that we had made a mistake and we needed to change course. And we didn't. We went the opposite direction," Kolodny said.

Over the next decade, opioid prescriptions would surge from 150 million to more than 200 million a year, the death rate would double, and the scourge would spread across the country.

When Manchin moved from the governor's mansion to Capitol Hill in 2010, he had already seen West Virginia ravaged by pain pills like Vicodin. The prescribing patterns made it clear the drugs were being diverted from legitimate use.

"They were everywhere," he said. "One little community of 300, 400 people had nine million pills coming into it."

He began pushing to tighten controls, urging that hydrocodone combination products like Vicodin be made Schedule II drugs, which would make them harder to get.

"I thought that would have been done in what — three-week period, maximum?" he said. "I go up and testify before [the FDA] advisory committee. It was automatically approved — boom! Should have been a slam-dunk, right?"

But it took nearly a year for the FDA to recommend the policy change. After it finally went into effect in 2014, a billion fewer of the affected pills were prescribed in the next year. Manchin said there's no doubt lives would have been saved if it had happened sooner.

"I can use many explicit words to describe what I think was wrong, but there is no reason on earth this shouldn't have happened," he said.

The FDA also came under fire in 2014 after it approved a very powerful opioid called Zohydro over the objections of its advisory committee, which voted 11-2 against it. Zohydro came with strong warnings and there's no indication it's been widely abused, but to watchdogs like Kolodny and Manchin, the FDA action was evidence the agency wasn't alarmed enough.

"Why did the FDA continue to allow more and more of these opiate drugs on the market?" Manchin said.

Kolodny said one answer may be that the FDA was too close to drug manufacturers. He points to a series of invitation-only meetings created by two academics that brought together FDA officials who oversaw painkillers with drug makers who paid thousands of dollars to attend meetings in swanky hotel conference rooms.

The so-called IMMPACT meetings could be interpreted as a "pay-to-play" operation, one government participant fretted in an email. NBC News has learned that the meetings were the subject of an Inspector General's probe. The investigative report NBC obtained says that while FDA employees did not receive any direct personal benefit, the probe found that meeting organizers may have paid travel expenses for three FDA officials. Others received free meals. Some received author's credit on research papers they had little to do with. The IG also found that the FDA did not require its officials to report that they attended the meetings — or even served on the steering committee.

Kolodny claims that a revolving door that funnels former FDA employees into an industry they once regulated may have blunted the agency's response to opioid misuse. One of the key officials involved in the original approval of Oxycontin went to work for Purdue within two years of leaving the agency, and the official who oversaw Zohydro's approval now consults for firms that involved in the opioid field.

"It was certainly in their self-interest to be very friendly to the manufacturers that wanted these products on the market. And the manufacturers, at the end of the day, got what they wanted," Kolodny said.

When Gottlieb was nominated by President Trump, some were worried that he was too close to the medical industry. Although he worked in a hospital early in his career, he more recently worked as a consultant and a venture capitalist for a firm that invested in medical businesses.

But some of those same skeptics say they have hope change is on the horizon.

"I didn't vote for him but I'm optimistic," Manchin said.

Soon after Gottlieb took over, the FDA pushed the opioid Opana off the market, deeming the risk of abuse was too high. He's also beefed up efforts to find drugs being sent by mail and notified 74 drugmakers that will have to provide more training for medical professionals who write pain-control prescriptions.

He's trying to expand access to medication-assisted treatment for opioid addicts and reduce the stigma associated with addiction. Another goal: repackaging pills in smaller quantities so a trip to the dentist doesn't end with a 30-day supply of narcotics.

"I don't think this is going to be a five-year effort," Gottlieb told NBC News. "But it will take us a year, maybe two to get to the optimal place here.

"In the meantime," he said, "we're taking a lot of actions that I think are starting to have an impact."

Gottlieb said he is acutely aware of the FDA's history with opioids as he looks to the future.

"I look to the past to try to understand what we did wrong, to inform what we can do right going forward," he said. "And that's where we are focused.

"I don't want to be looking back five years from now and say, 'I wish I had done more.'"