Background: Determinants of the duration of opioid use after surgery have not been reported. We hypothesized that both preoperative psychological distress and substance abuse would predict more prolonged opioid use after surgery. Methods: Between January 2007 and April 2009, a prospective, longitudinal inception cohort study enrolled 109 of 134 consecutively approached patients undergoing mastectomy, lumpectomy, thoracotomy, total knee replacement, or total hip replacement. We measured preoperative psychological distress and substance use, and then measured the daily use of opioids until patients reported the cessation of both opioid consumption and pain. The primary end point was time to opioid cessation. All analyses were controlled for the type of surgery done. Results: Overall, 6% of patients continued on new opioids 150 days after surgery. Preoperative prescribed opioid use, depressive symptoms, and increased self-perceived risk of addiction were each independently associated with more prolonged opioid use. Preoperative prescribed opioid use was associated with a 73% (95% confidence interval [CI] 0.51%-87%) reduction in the rate of opioid cessation after surgery (P = 0.0009). Additionally, each 1-point increase (on a 4-point scale) of self-perceived risk of addiction was associated with a 53% (95% CI 23%-71%) reduction in the rate of opioid cessation (P = 0.003). Independent of preoperative opioid use and self-perceived risk of addiction, each 10-point increase on a preoperative Beck Depression Inventory II was associated with a 42% (95% CI 18%-58%) reduction in the rate of opioid cessation (P = 0.002). The variance in the duration of postoperative opioid use was better predicted by preoperative prescribed opioid use, self-perceived risk of addiction, and depressive symptoms than postoperative pain duration or severity. Conclusions: Preoperative factors, including legitimate prescribed opioid use, self-perceived risk of addiction, and depressive symptoms each independently predicted more prolonged opioid use after surgery. Each of these factors was a better predictor of prolonged opioid use than postoperative pain duration or severity. © 2012 International Anesthesia Research Society.