Atrial fibrillation (AF) and periodontitis, both classified under chronic inflammatory diseases, share common etiologies, including genetic factors and immune pathways. However, the exact mechanisms are still poorly understood. This study aimed to explore the potential common genes and immune characteristics between AF and periodontitis. Gene expression datasets for AF and periodontitis were downloaded from the Gene Expression Omnibus (GEO) database. Differential expression analysis was used to identify common genes in the training set. Functional analyses, including Gene Ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment, were conducted to elucidate the underlying mechanisms. Hub genes were further screened based on expression levels, receiver operating characteristic (ROC) curves, and least absolute shrinkage and selection operator (LASSO) regression. Then, based on the expression levels and ROC values of the hub genes in the validation set, the target genes were identified. Finally, immune cell infiltration analysis was performed on the AF and periodontitis datasets in the training set using the "CIBERSORT" R package. The relationships between target genes, infiltrating immune cells, and inflammatory factors were also investigated. In addition, AF susceptibility, atrial fibrosis, inflammatory infiltration, and RGS1 protein expression in rat models of periodontitis were assessed through invivo electrophysiology experiments, Masson's trichrome staining, hematoxylin-eosin staining, immunohistochemistry, and western blotting, respectively. A total of 21 common genes were identified between AF and periodontitis among the differentially expressed genes. After evaluating gene expression levels, ROC curves, and LASSO analysis, four significant genes between AF and periodontitis were identified, namely regulator of G-protein signaling 1 (RGS1), annexin A6 (ANXA6), solute carrier family 27 member 6 (SLC27A6), and ficolin 1 (FCN1). Further validation confirmed that RGS1 was the optimal shared target gene for AF and periodontitis. Immune cell infiltration analysis revealed that neutrophils and T cells play an important role in the pathogenesis of both diseases. RGS1 showed a significant positive correlation with activated memory CD4 T cells and gamma-delta T cells and a negative correlation with CD8 T cells and regulatory T cells in both training sets. Moreover, RGS1 was positively correlated with classical pro-inflammatory cytokines IL1β and IL6. In periodontitis rat models, AF susceptibility, atrial fibrosis, and inflammatory infiltration were significantly increased, and RGS1 expression in the atrial tissue was upregulated. A common gene between AF and periodontitis, RGS1 appears central in linking the two conditions. Immune and inflammatory responses may underlie the interaction between AF and periodontitis.