A federal judge sentenced John Kapoor, the founder of the opioid manufacturer Insys Therapeutics, to five and a half years in prison Thursday for his role in a racketeering scheme that bribed doctors to prescribe a highly addictive opioid and misled insurers.

The case had been closely watched because it represented a rare criminal inquiry into the practices of a drug company that aggressively sold painkillers while the nation was in the grip of a deadly opioid epidemic that killed thousands of people in the last decade.

Beth Wilkinson, a lawyer for Mr. Kapoor, declined to comment on the sentencing but said she planned to appeal.

Federal prosecutors have said that Insys, based in Arizona, embarked on an intensive marketing plan — including paying doctors for sham educational talks and luring others with lap dances — to sell its under-the-tongue fentanyl spray, Subsys, which was federally approved to treat patients with cancer.