Sitting in a Boston courtroom in a dark, pinstriped suit, the former top sales executive at Insys Therapeutics, Alex Burlakoff, listened as federal prosecutors read out crimes he and the company had allegedly committed.

Insys had bribed doctors and their employees with payments for sham medical events that often turned out to be parties. Physicians who didn't write prescriptions for the company's powerful opioid were cut off from the company's money. There were lavish dinners, strip-club visits and gun-range outings, all of which led to booming sales of one of the world's most powerful — and dangerous — pain drugs.

Burlakoff was prepared to plead guilty, his lawyers told the judge last week. There was even more evidence that prosecutors hadn't listed, they said. He's one of the first drug-company executives charged in the mounting legal backlash to the U.S. opioid epidemic, which was tied to about 50,000 deaths last year. Burlakoff faces as many as 20 years in prison, though he has a cooperation agreement with the government as other former Insys executives go to trial in January.

The company, meanwhile, could become the first corporate casualty of the opioid epidemic. Its sales have plunged as it spends millions of dollars on legal defenses of former execs, including billionaire founder and ex-CEO John Kapoor.

In a desperate bid to save itself, Insys' new managers are trying to sell off its main pain drug to a corporate buyer to raise money. They hope to use the proceeds to pivot out of the opioid business and into something slightly less controversial: cannabis-derived drugs.

Insys' main product is Subsys, a spray version of the ultrapowerful opioid fentanyl. When it was introduced in the U.S. in 2012 with a price tag ranging between $3,000 and $16,000 a month, depending on the dose, it was subject to a tightly controlled distribution system. The Food and Drug Administration allowed the company to market it to cancer patients, to help relieve their pain.

It didn't sell well, at least at first. That changed, federal prosecutors have alleged, when Kapoor and other executives essentially bribed doctors to prescribe it for a range of things from chronic pain to back aches, and defrauded insurance providers who were reluctant to approve prescriptions for off-label use. In some cases, doctors were paid more than $200,000, prosecutors said at the hearing last week where Burlakoff pleaded guilty.

Attorneys for Burlakoff and Kapoor didn't respond to separate requests for comment.

Business boomed. Subsys sales grew from $8.6 million when it launched in March 2012 to $329.5 million in 2015, making up most of the firm's revenue. At the drug's peak in 2015, Insys had a market valuation of more than $2 billion.

Then, in June 2015, a Connecticut nurse pleaded guilty to federal charges of accepting more than $83,000 in kickbacks from the company. There were indictments of doctors, nurses, sales representatives and, eventually, Insys executives. In August, the company agreed to a $150 million settlement with the Department of Justice to resolve a civil and criminal probe, with the potential for as much as $75 million more due.

Sales plunged 80 percent from their 2015 peak. Subsys accounts for more than 95 percent of the company's revenue.

Now Insys is trying to find a new line of business by becoming a "cannabinoid pioneer," said McGrath. It's one of the hottest areas in medicine, and investors have flocked to tiny companies promising to win the race for a new class of marijuana-derived therapies. Insys already produces one of a few drugs approved by the Food and Drug Administration made from synthetic cannabinoids, or marijuana-inspired compounds.

Insys isn't alone in facing opioid-related legal issues. Hundreds of cases have been filed against pharmaceutical companies and distributors. But no company's troubles may be more acute than Insys'.

"They're fighting a losing battle," said Robert Valuck, a professor of pharmacy at the University of Colorado Anschutz Medical Campus and director of the Colorado Consortium for Prescription Drug Abuse Prevention, which works with lawmakers to address the opioid crisis. "Whether they keep trying to defend or sell Subsys, there's going to be some amount of perception that this is the product that got them sued."