The US government missed the opportunity to curb sales of the drug that kickstarted the opioid epidemic when it secured the only criminal conviction against the maker of OxyContin a decade ago.

Purdue Pharma hired Rudolph Giuliani, the former New York mayor and now Donald Trump’s lawyer, to head off a federal investigation in the mid-2000s into the company’s marketing of the powerful prescription painkiller at the centre of an epidemic estimated to have claimed at least 300,000 lives.

While Giuliani was not able to prevent the criminal conviction over Purdue’s fraudulent claims for OxyContin’s safety and effectiveness, he was able to reach a deal to avoid a bar on Purdue doing business with the federal government which would have killed a large part of the multibillion-dollar market for the drug.

The former New York mayor also secured an agreement that greatly restricted further prosecution of the pharmaceutical company and kept its senior executives out of prison.

The US attorney who led the investigation, John Brownlee, has defended the compromise but also expressed surprise that Purdue did not face stronger action from federal regulators and further criminal investigation given its central role in the rise of the epidemic.

Connecticut-based Purdue is now facing a wave of civil lawsuits as New York, Texas and five other states have joined a growing number actions against the company. But Brownlee was the first, and so far only, prosecutor to secure a criminal conviction against the drug maker.

Brownlee launched his investigation shortly after being appointed US attorney for the western district of Virginia as the region struggled with escalating overdoses and deaths from opioids in the early 2000s. When he looked at the source of the epidemic he found OxyContin, a drug several times more powerful than any other prescription painkiller on the market at the time.

Q&A Why is there an opioid crisis in America? Show Almost 100 people are dying every day across America from opioid overdoses – more than car crashes and shootings combined. The majority of these fatalities reveal widespread addiction to powerful prescription painkillers. The crisis unfolded in the mid-90s when the US pharmaceutical industry began marketing legal narcotics, particularly OxyContin, to treat everyday pain. This slow-release opioid was vigorously promoted to doctors and, amid lax regulation and slick sales tactics, people were assured it was safe. But the drug was akin to luxury morphine, doled out like super aspirin, and highly addictive. What resulted was a commercial triumph and a public health tragedy. Belated efforts to rein in distribution fueled a resurgence of heroin and the emergence of a deadly, black market version of the synthetic opioid fentanyl. The crisis is so deep because it affects all races, regions and incomes

Purdue turned OxyContin into a multibillion-dollar drug after its launch in 1996 with an unprecedented campaign marketing the painkiller to doctors. OxyContin contained a much higher dose of narcotic than other painkillers because it was designed to bleed slowly into a patient’s system over 12 hours and save having to take lower dosage pills more regularly. Purdue told doctors that not only was this more effective at subduing pain but it was less likely to cause addiction and more resistant to abuse by people hooked on drugs.

These were important selling points to a medical profession still wary of opioids because of concerns about addiction, and demand for OxyContin quickly surged. But it almost as swiftly became apparent to prosecutors that neither claim was true as doctors reported increasing numbers of people becoming addicted to the high dosage, and that those already hooked on opioids found it easy to extract the narcotic by crushing the pills.

OxyContin became the go-to drug for people looking for an instant high by snorting or injecting.

“This was the magic pill, right? This was a long-acting pill that the addicts wouldn’t like and you couldn’t get dependent on, and that is the magic bullet. The reality is it just wasn’t true,” said Brownlee. “It was highly deceptive and then they trained their sales force to go out and to push that deception on physicians.”

Investigators waded through several million of Purdue’s internal memos, marketing documents and notes from sales representatives. Brownlee’s office discovered training videos in which reps acted out selling the drug using the false claims. “This was pushed by the company to be marketed in an illegal way, pushed from the highest levels of the company, that in my view made them a criminal enterprise that needed to be dealt with,” said Brownlee.

OxyContin is at the centre of an epidemic estimated to have claimed at least 300,000 lives. Photograph: Toby Talbot/AP

When Purdue discovered it was under investigation it dispatched Giuliani, fresh from his term as mayor of New York during the 9/11 attacks, in the twin roles of heavyweight lawyer to confront the young prosecutor while also working his powerful connections in Washington. Giuliani met repeatedly with Brownlee. At first the Purdue lawyer tried to persuade the prosecutor that he had got it all wrong.

“It was basically, you need to look at the company differently. All we do is make a product and we give it to doctors and doctors ultimately make the choice,” said Brownlee.

The prosecutor heard Giuliani out but regarded his attempts to load responsibility on to doctors as missing the point. “What were the doctors being told? That was the real rub. To me the biggest evidence were the videos of the training sessions. When I saw that, you now know that this is what the corporation wants the doctors to know, and it just wasn’t true,” said Brownlee.

The US attorney had six meetings with Giuliani. They moved from how to interpret the evidence and questions around discovery to negotiations over the final settlement.

But Giuliani and his team seemed to be also working their Washington contacts. The Purdue lawyers complained to the office of the then deputy attorney general, James Comey, whose tenure as head of the FBI lay ahead of him, that Brownlee was exceeding his legal authority in pursuit of documents from the company.

“The defence lawyers contacted Mr Comey unbeknownst to us and said those guys down there are crazy,” said Brownlee. The US attorney went to Washington to explain to Comey in person. Purdue was not instantly recognizable as a pharmaceutical company to most people in DC. The name was easily mistaken for Perdue Farms, a regional chicken producer well known for its television ads featuring the owner, Frank Perdue. “Mr Comey said, why are you prosecuting the chicken guy?” said Brownlee.

Once that misunderstanding was cleared up, Comey signed off on Brownlee’s actions and Purdue was forced to hand over the documents. Brownlee set the drug maker a deadline in October 2006 to agree to the plea deal or face a trial. Hours before it expired, the federal prosecutor received a call at home from a senior justice department official, Michael Elston, chief of staff to the new deputy attorney general, Paul McNulty.

Elston asked why the case was being pushed along so rapidly and pressed for a delay. The prosecutor again saw the influence of Purdue’s lawyers at work and cut the call short. It wasn’t unusual for corporate lawyers to try to get leverage with senior justice department officials but Elston’s call, just as Purdue had its back to the wall, seemed to the then prosecutor unusually interventionist because he had shown no interest in the case before. Elston’s lawyer has since claimed that his client called Brownlee on instructions from above.

It was highly deceptive and then they trained their sales force to go out and to push that deception on physicians John Brownlee, the US ​​attorney who led the investigation

Within hours of Brownlee hanging up on Elston, Purdue accepted a plea deal admitting to criminal charges of mis-selling OxyContin with “intent to defraud or mislead”. In 2007, after a court hearing confirming the conviction, Brownlee hailed it as a “crushing defeat” for the drug maker.

But Giuliani won an important concession for Purdue. Corporations with criminal convictions are mostly barred from doing business with the federal government. If Purdue Pharma’s name was on the conviction it would probably have forced OxyContin from public health programs such as Medicaid and Medicare and the Veterans Administration health system. That in turn was likely to diminish its prescribing in the private health system.

Brownlee said he did not want to be responsible for taking OxyContin off the market and so agreed with Giuliani to target the prosecution at the parent company, Purdue Frederick. That left Purdue Pharma, cleaved out as a separate painkiller manufacturer in 1991, to continue selling the painkiller without restriction even though opioid deaths were escalating.

“I didn’t feel as a lawyer I could be in a position to bar anyone from getting OxyContin. Faced with that decision, I was just simply not prepared to take it off the market. I didn’t feel like that was my role. My role was to address prior criminal conduct. Hold them accountable. Fine them. Make sure the public knew what they did. ” said Brownlee.

Brownlee said he expected federal regulators, particularly the Food and Drug Administration, and other agencies to use the criminal conviction to look more closely at Purdue and its drug. But there was no follow-up and OxyContin went on being widely prescribed.

Purdue was fined $640m, a fraction of its total profits from OxyContin. Three Purdue executives pleaded guilty to misdemeanors and were fined a total of $34.5m between them, a reflection of their earnings from the drug.

Giuliani also won a second concession that immunized Purdue from further prosecution even though its criminal conduct continued after the period covered by the plea agreement. The prosecution covered its crimes committed up until 2001, but the mis-selling went on for years afterwards. Giuliani negotiated an agreement which immunized the company from further prosecution for its actions up to 2007 when the guilty plea was finalized in court.

Critics of the deal, such as the watchdog Public Citizen, said the company sold nearly $5bn worth of OxyContin between the two dates.

A decade later, with tens of thousands more lives claimed by the epidemic kickstarted by OxyContin, Brownlee said he does not regret his handling of the case but said he had expected other prosecutors and federal regulators to pick up the baton to rein in the spread of OxyContin.

“I think convicting the company, the fines and all of that had its impact. I guess as I sit here now, I’m a little surprised that it’s the only one of its kind. That with the nature of the abuse and the nature of the problem, that as we sit here that there’s no other out there,” he said.

Chris McGreal’s book, American Overdose: The Opioid Tragedy in Three Acts, is published in November.