Background: The opioid crisis has reached epidemic proportions, yet risk of persistent opioid use following curative intent surgery for cancer and factors influencing this risk are not well understood. Methods: We used electronic health record data from 3,901 adult patients who received a prescription for an opioid analgesic related to hysterectomy or large bowel surgery from January 1, 2013, through June 30, 2018. Patients with and without a cancer diagnosis were matched on the basis of demographic, clinical, and procedural variables and compared for persistent opioid use. Results: Cancer diagnosis was associated with greater risk for persistent opioid use after hysterectomy [18.9% vs. 9.6%; adjusted OR (aOR), 2.26; 95% confidence interval (CI), 1.38–3.69; P ＝ 0.001], but not after large bowel surgery (28.3% vs. 24.1%; aOR 1.25; 95% CI, 0.97–1.59; P ＝ 0.09). In the cancer hysterectomy cohort, persistent opioid use was associated with cancer stage (increased rates among those with stage III cancer compared with stage I) and use of neoadjuvant or adjuvant chemotherapy; however, these factors were not associated with persistent opioid use in the large bowel cohort. Conclusions: Patients with cancer may have an increased risk of persistent opioid use following hysterectomy. Impact: Risks and benefits of opioid analgesia for surgical pain among patients with cancer undergoing hysterectomy should be carefully considered.