The aim of this study was to investigate the functional effect of miR-338-5p targeting IL-6 on NF-κB/MAPK pathway-mediated inflammation and oxidative stress in atrial fibrillation (AF) rats. AF model rats were generated by tail vein injection of 0.1 mL Ach-CaCl2 mixture. The overexpression and suppression of miR-338-5p were established by injecting a miR-338-5p-agomir and a miR-338-5p-antagomir, respectively, into AF rats. Cardiac morphological changes were detected by H&E and Masson staining. The levels of ROS, SOD, T-AOC, IL-6, IL-1β, and TNF-α were detected via ELISA. Dual luciferase assays, qRT‒PCR, and western blotting were used to verify that miR-338-5p targets IL-6. The expression of NF-κB/MAPK pathway proteins was detected by western blot. Overexpression of miR-338-5p ameliorated heart damage in AF rats. Increased miR-338-5p reduced the levels of CK, CK-MB, and cTnT to alleviate myocardial injury. Furthermore, overexpression of miR-338-5p relieved inflammation and oxidative stress by downregulating SOD and T-AOC and upregulating IL-6, IL-1β, TNF-α, and ROS. Further research revealed that upregulation of miR-338-5p reduced the protein levels of p-p38, p-p65 and p-ERK1/2. The opposite results were obtained following miR-338-5p-antagomir treatment. Taken together, these findings indicate that the upregulation of miR-338-5p alleviated inflammation and oxidative stress by targeting IL-6 to inhibit the NF-κB/MAPK pathway, thus providing a new therapeutic target for AF.