Background: Epicardial adipose tissue(EAT) is associated with inflammation in previous studies but is unknown in patients with ST-segment elevation myocardial infarction(STEMI).This study investigated the correlation between epicardial fat and inflammatory cells obtained by cardiac magnetic resonance (CMR) and the effect on atrial arrhythmias in patients with STEMI.<br /> Methods: This was a single-center, retrospective study. We consecutively selected patients who all completed CMR after Percutaneous Coronary Intervention (PCI) from January 2019 to December 2022 and then had regular follow-ups at 1, 3, 6, 9, and 12 months. The enrolled patients were grouped according to the presence or absence of atrial arrhythmia and divided into atrial and non-atrial arrhythmia groups.<br /> Results: White blood cell, neutrophil, lymphocyte, C-reactive protein, EATV, LVES, LVED were higher in the atrial arrhythmia group than in the non-atrial arrhythmia group, and LVEF was lower than that in the non-atrial arrhythmia group (p < 0.05); EATV was significantly positively correlated with each inflammatory indices (white blood cell: r = 0.415 p < 0.001, neutrophil:r = 0.386 p < 0.001, lymphocyte:r = 0.354 p < 0.001, Creactive protein:r = 0.414 p < 0.001); one-way logistic regression analysis showed that risk factors for atrial arrhythmias were age, heart rate, white blood cell, neutrophil, lymphocyte, C-reactive protein, EATV, LVES, LVED; multifactorial logistic regression analysis showed that neutrophil, lymphocyte, C-reactive protein, EATV, and LVES were independent risk factors for atrial arrhythmias; ROC analysis showed that the area under the curve (AUC) for neutrophil was 0.862; the AUC for lymphocyte was 1.95; and the AUC for C-reactive protein was 0.862. reactive protein was 0.852; AUC for LVES was 0.683; and AUC for EATV was 0.869.<br /> Conclusion: In patients with STEMI, EAT was significantly and positively correlated with inflammatory indices; neutrophil, lymphocyte, C-reactive protein, EATV, and LVES were independent risk factors for atrial arrhythmias and had good predictive value.