Statins reduce recurrent stroke and cardiovascular events in patients with non-cardioembolic stroke. The benefits of statins in patients with AF and recent IS remain unclear. We aimed to investigate the benefits of statins in patients with AF and recent IS. This retrospective, cohort study was conducted using deidentified electronic medical records within TriNetX platform. Patients with AF and recent IS, who received statins within 28 days of their index stroke were propensity score-matched with those who did not. Patients were followed up for up to 2 years. Primary outcomes were the 2-year risk of recurrent IS, all-cause mortality and the composite outcome of all-cause mortality, recurrent IS, transient ischaemic attack (TIA), and acute myocardial infarction (MI). Secondary outcomes were the 2-year risk of TIA, intracranial haemorrhage (ICH), acute MI, and hospital readmission. Cox regression analyses were used to calculate hazard ratios (HRs) with 95% confidence intervals (95%CI). Of 20,902 patients with AF and recent IS, 7500 (35.9%) received statins within 28 days of their stroke and 13,402 (64.1%) did not. 11,182 patients (mean age 73.7 ± 11.5; 5277 (47.2%) female) remained after propensity score matching. Patients who received early statins had significantly lower risk of recurrent IS (HR: 0.45, 95%CI: 0.41-0.48, p < 0.001), mortality (HR: 0.75, 95%CI: 0.66-0.84, p < 0.001), the composite outcome (HR: 0.48, 95%CI: 0.45-0.52, p < 0.001), TIA (HR: 0.37, 95%CI: 0.30-0.44, p < 0.001), ICH (HR: 0.59, 95%CI: 0.47-0.72, p < 0.001 ), acute MI (HR: 0.35, 95%CI: 0.30-0.42, p < 0.001) and hospital readmission (HR: 0.46, 95%CI: 0.42-0.50, <0.001). Beneficial effects of early statins were evident in the elderly, different ethnic groups, statin dose intensity, and AF subtypes, large vessel occlusion and embolic strokes and within the context of statin lipophilicity, optimal LDL-cholesterol levels, various cardiovascular comorbidities, treatment with intravenous thrombolysis or endovascular thrombectomy, and NIHSS 0-5 and NIHSS > 5 subgroups. Patients with AF and recent IS, who received early statins, had a lower risk of recurrent stroke, death, and other cardiovascular outcomes including ICH, compared to those who did not.