IMPORTANCE: Chronic opioid use imposes a substantial burden in terms of morbidity and economic costs. Whether opioid-naive patients undergoing surgery are at increased risk for chronic opioid use is unknown, as are the potential risk factors for chronic opioid use following surgery. OBJECTIVE: To characterize the risk of chronic opioid use among opioid-naive patients following 1 of 11 surgical procedures compared with nonsurgical patients. DESIGN, SETTING, AND PARTICIPANTS: Retrospective analysis of administrative health claims to determine the association between chronic opioid use and surgery among privately insured patients between January 1, 2001, and December 31, 2013. The data concluded 11 surgical procedures (total knee arthroplasty [TKA], total hip arthroplasty, laparoscopic cholecystectomy, open cholecystectomy, laparoscopic appendectomy, open appendectomy, cesarean delivery, functional endoscopic sinus surgery [FESS], cataract surgery, transurethral prostate resection [TURP], and simple mastectomy). Multivariable logistic regression analysis was performed to control for possible confounders, including sex, age, preoperative history of depression, psychosis, drug or alcohol abuse, and preoperatice use of benzodiazepines, antipsychotics, and antidepressants. EXPOSURES: One of the 11 study surgical procedures. MAIN OUTCOMES AND MEASURES: Chronic opioid use, defined as having filled 10 or more prescriptions or more than 120 days supply of an opioid in the first year after surgery, excluding the first 90 postoperative days. For nonsurgical patients, chronic opioid use was defined as having filled 10 or more prescriptions or more than 120 days supply following a randomly assigned “surgery date.” RESULTS: The study included 641 941 opioid-naive surgical patients (169 666 men; mean [SD] age, 44.0 [12.8] years), and 18 011 137 opioid-naive nonsurgical patients (8 849 107 men; mean [SD] age, 42.4 [12.6] years). Among the surgical patients, the incidence of chronic opioid in the first preoperative year ranged from 0.119% for Cesarean delivery (95% CI, 0.104%-0.134%) to 1.41% for TKA (95% CI, 1.29%-1.53%) The baseline incidence of chronic opioid use among the nonsurgical patients was 0.136% (95% CI, 0.134%-0.137%). Except for cataract surgery, laparoscopic appendectomy, FESS, and TURP, all of the surgical procedures were associated with an increased risk of chronic opioid use, with odds ratios ranging from 1.28 (95% CI, 1.12-1.46) for cesarean delivery to 5.10 (95% CI, 4.67-5.58) for TKA. Male sex, age older than 50 years, and preoperative history of drug abuse, alcohol abuse, depression, benzodiazepine use, or antidepressant use were associated with chronic opioid use among surgical patients. CONCLUSIONS AND RELEVANCE: In opioid-naive patients, many surgical procedures are associated with an increased risk of chronic opioid use in the postoperative period. A certain subset of patients (eg, men, elderly patients) may be particularly vulnerable.