OBJECTIVES: To identify the incidence, characteristics, and factors associated with against medical advice (AMA) discharge among hospitalized patients with opioid use disorder (OUD) and injection related infections (eg, endocarditis, osteomyelitis, epidural abscesses). METHODS: This retrospective cohort study evaluated adults with OUD admitted to an academic medical center from January 1, 2016 to January 7, 2019 for an invasive injection related infection. Multivariable logistic regression was used to determine independent factors associated with AMA discharge. RESULTS: Among 262 adults admitted with serious injection related infections and comorbid OUD, 138 received inpatient medications for opioid use disorder (MOUD). Univariate analysis showed a decreased odds ratio (OR) of AMA discharge when patients received MOUD inpatient (OR 0.55; 95% CI 0.34-0.91.). Adjusting for covariates associated with social determinants of health and other substance use, inpatient receipt of MOUD was associated with a decreased risk of AMA discharge (adjusted OR 0.49; 95% CI 0.028-0.84). CONCLUSIONS: Among patients with OUD and serious injection related infections, inpatient initiation of MOUD is associated with decreased risk of AMA discharge.