Perceived risks of hyperkalemia and acute renal insufficiency may limit use of mineralocorticoid receptor antagonist (MRA) therapy in patients with heart failure, especially those with diabetes mellitus or chronic kidney disease. Using clinical registry data linked to Medicare claims, we analyzed patients hospitalized with heart failure between 2005 and 2013 with a history of diabetes mellitus or chronic kidney disease. We stratified patients by MRA use at discharge. We used inverse probability-weighted proportional hazards models to assess associations between MRA therapy and 30-day, 1-year, and 3-year mortality, all-cause readmission, and readmission for heart failure, hyperkalemia, and acute renal insufficiency. We performed interaction analyses for differential effects on 3-year outcomes for reduced, borderline, and preserved ejection fraction. Of 16 848 patients, 12.3% received MRA therapy at discharge. Higher serum creatinine was associated with lower odds of MRA use (odds ratio, 0.66; 95% confidence interval, 0.61-0.71); serum potassium was not (odds ratio, 1.00; 95% confidence interval, 0.90-1.11). There was no mortality difference between groups. MRA therapy was associated with greater risks of readmission for hyperkalemia and acute renal insufficiency and lower risks of long-term all-cause readmission. Patients on MRA therapy with borderline or preserved ejection fraction had greater risks of readmission for hyperkalemia (P=0.02) and acute renal insufficiency (P<0.001); patients with reduced ejection fraction did not. Among patients with heart failure and diabetes mellitus or chronic kidney disease, MRA use was associated with lower risk of all-cause readmission despite greater risk of hyperkalemia and acute renal insufficiency.