Opioid use is associated with unintentional and intentional overdose and is one of the leading causes of emergency room visits and accidental deaths. However, the association between opioid abuse/dependence and outcomes in hospitalized patients has not been well studied. Congestive heart failure (HF) is the fourth most common cause of hospitalization in the United States. The purpose of this study was to examine the effect of opioid abuse/dependence on outcomes in patients hospitalized with HF. We queried the 2002–2010 Nationwide Inpatient Sample databases to identify all patients aged 18 years and older admitted with the primary diagnosis of HF. Multivariate logistic regression analysis was used to compare the frequency of hospital-acquired conditions (HACs) and in-hospital mortality between patients with and without a history of opioid abuse/dependence. Of 9,993,240 patients with HF, 29,014 had a history of opioid abuse or dependence. Opioid abusers/dependents were likely to be younger men of poor socioeconomic background with self pay or Medicaid as their primary payer. They had a lower prevalence of dyslipidemia, diabetes mellitus, coronary artery disease, prior myocardial infarction, and peripheral vascular disease (P < 0.001 for all). They were more likely to be smokers and have chronic pulmonary disease, depression, liver disease, and obesity (P < 0.001 for all). Patients with a history of opioid abuse/dependence had lower incidence of HACs (14.8% vs. 16.5%, adjusted odds ratio: 0.71, P < 0.001) and lower in-hospital mortality (1.3% vs. 3.6%, adjusted odds ratio: 0.64, P < 0.001) as compared with patients without prior opioid abuse/dependence. In conclusion, among adult patients aged 18 years and older hospitalized with HF, opioid abuse/dependence was associated with lower frequency of HACs and lower in-hospital mortality.