Background: Cardiac surgery-associated acute kidney injury (CSA-AKI) is a common and serious complication after cardiac surgery. The influence of statin use before surgery on the renal outcome of patients undergoing cardiac surgery is controversial. The purpose of this study was to evaluate the effect of statins on postoperative renal outcomes in patients undergoing cardiac surgery.Methods: We included CSA-AKI patients in the Medical Information Mart for Intensive Care (MIMIC)—IV database and were divided into statin group and non-statin group according to whether they used statins before entering intensive care units (ICU). The main outcomes were hospitalization and 30-day mortality, and the secondary outcomes were 60-day mortality and 90-day mortality. We used propensity score matching (PSM) to adjust for confounding factors. The 95% confidence interval (CI) and risk ratio (RO) were calculated by the COX proportional regression model. At the same time, stratified analysis was used to explore whether the relationship between the statins use before intensive care units and mortality was different in each subgroup and whether the relationship between different doses of Atorvastatin and mortality was different.Result: We identified 675 pre-ICU statin users and 2095 non-statin users. In the COX proportional regression model, pre-ICU statin use was associated with decreased in-hospital (HR = 0.407, 95%confidence interval 0.278–0.595, p < 0.001) and 30-day mortality (HR = 0.407, 95%CI 0.279–0.595, p < 0.001). The survival rate of patients who took statins before entering ICU was significantly higher than that of those who did not use statins at 30 days, 60 days and 90 days. There is a significant interaction between patients with aged>65 years (HR = 0.373, 95%CI 0.240–0.581, p < 0.001), Acute kidney injury grade I (HR = 0.244, 95%CI 0.118–0.428, p < 0.001), and without post-myocardial infarction syndrome (HR = 0.344, 95%CI 0.218–0.542, p < 0.001). The mortality in hospital and 60 days of CSA-AKI patients treated with ≥80 mg Atorvastatin before operation was significantly reduced (p < 0.05).Conclusion: The pre-ICU statin use was significantly associated with decreased risk in hospital and 30-day mortality. The preoperative use of ≥80 mg Atorvastatin may improve the prognosis of CSA-AKI.