The aim of this study was to study the association of perioperative administration of renin angiotensin system inhibitors (RASi) and clinical outcomes of patients with heart failure (HF) undergoing cardiac surgery. Summary Background Data: It is controversial whether the perioperative RASi should be administered in HF patients undergoing cardiac surgery. Methods: A total of 2338 patients with HF and undergoing CABG and/ or valve surgeries at multiple hospitals from 2001 to 2015 were identified from STS database. After adjustment using propensity score and instrumental variable, logistic regression was conducted to analyze the influence of preoperative continuation of RASi (PreRASi) on short-term in-hospital outcomes. Independent risk factors of 30-day mortality, major adverse cardiovascular events (MACE), and renal failure were analyzed by use of stepwise logistic regression. The effects of pre-and postoperative use of RASi (PostRASi) on long-term mortality were analyzed using survival analyses. Stepwise Cox regression was conducted to analyze the independent risk factors of 6-year mortality. The relationships of HF status and surgery type with perioperative RASi, as well as PreRASi-PostRASi, were also evaluated by subgroup analyses. Results: PreRASi was associated with lower incidences of 30-day mortality [P < 0.0001, odds ratio (OR): 0.556, 95% confidence interval (CI) 0.405−0.763], stroke (P =0.035, OR: 0.585, 95% CI: 0.355−0.962), renal failure (P =0.007, OR: 0.663, 95% CI: 0.493-0.894). Both PreRASi (P =0.0137) and PostRASi (P =0.007) reduced 6-year mortality compared with the No-RASi groups. Conclusions: Pre-and postoperative use of RASi was associated with better outcomes for the patients who have HF and undergo CABG and/ or valve surgeries. Preoperative continuation and postoperative restoration are warranted in these patients.