Aims This meta-analysis was conducted to compare the efficacy and safety of rivaroxaban with warfarin in patients with atrial fibrillation (AF) and diabetes mellitus. Methods PubMed, Embase, Cochrane Library, and Web of Science databases were systematically searched from the establishment of databases up to 15 October 2019. Studies on efficacy and safety outcomes of rivaroxaban and warfarin were included. Efficacy and safety outcomes, including stroke, ischemic stroke, stroke or systemic embolism, myocardial infarction, major adverse cardiac events, major bleeding, intracranial hemorrhage, and major gastrointestinal bleeding were collected for meta-analysis. Results Compared with warfarin, rivaroxaban could significantly reduce stroke (risk ratio [RR] 0.77; 95% confidence interval [CI] 0.63-0.95; P = 0.01), ischemic stroke (RR 0.74; 95% CI 0.63-0.87; P = 0.0004), stroke or systemic embolism (RR 0.73; 95% CI 0.60-0.89; P = 0.002), myocardial infarction (RR 0.68; 95% CI 0.56-0.82; P < 0.0001), and major adverse cardiac events (RR 0.71; 95% CI 0.53-0.94; P = 0.02) in patients with AF and diabetes. Moreover, rivaroxaban was associated with a lower risk of major bleeding (RR 0.79; 95% CI 0.65-0.96; P = 0.02), intracranial hemorrhage (RR 0.52; 95% CI 0.39-0.69; P < 0.00001), and major gastrointestinal bleeding (RR 0.74; 95% CI 0.56-0.98; P = 0.04). Similar results were obtained in stratified meta-analysis of cohort studies. Conclusion Our study suggests a favorable risk-benefit profile of rivaroxaban, with superior efficacy and safety over warfarin in patients with AF and diabetes.