Cerebral ischemia-reperfusion injury is a common complication of ischemic stroke that affects the prognosis of patients with ischemic stroke. The lipid-soluble diterpene Tanshinone IIA, which was isolated from Salvia miltiorrhiza, has been indicated to reduce cerebral ischemic injury. In this study, we investigated the molecular mechanism of Tanshinone IIA in alleviating reperfusion-induced brain injury. Middle cerebral artery occlusion animal models were established, and neurological scores, tetrazolium chloride staining, brain volume quantification, wet and dry brain water content measurement, Nissl staining, enzyme-linked immunosorbent assay, flow cytometry, western blotting, and reverse transcription-quantitative polymerase chain reaction were performed. The viability of cells was measured by 3-[4,5-dimethylthiazol-2-yl]-2,5-diphenyl tetrazolium bromide assays, while cell damage was measured by lactate dehydrogenase release in the in vitro oxygen glucose deprivation model. In addition, enzyme-linked immunosorbent assay, flow cytometry, western blotting, and reverse transcription-quantitative polymerase chain reaction were used to evaluate the therapeutic effect of Tanshinone IIA on ischemia/reperfusion (I/R) induced brain injury, as well as its effects on the inflammatory response and neuronal apoptosis, in vivo and in vitro. Furthermore, this study validated the targeting relationship between miR-124-5p and FoxO1 using a dual luciferase assay. Finally, we examined the role of Tanshinone IIA in brain injury from a molecular perspective by inhibiting miR-124-5p or increasing FoxO1 levels. After treatment with Tanshinone IIA in middle cerebral artery occlusion-reperfusion (MCAO/R) rats, the volume of cerebral infarction was reduced, the water content of the brain was decreased, the nerve function of the rats was significantly improved, and the cell damage was significantly reduced. In addition, Tanshinone IIA effectively inhibited the I/R-induced inflammatory response and neuronal apoptosis, that is, it inhibited the expression of inflammatory cytokines IL-1β, IL-6, TNF-α, decreased the expression of apoptotic protein Bax and Cleaved-caspase-3, and promoted the expression of antiapoptotic protein Bcl-2. In vitro oxygen-glucose deprivation/reoxygenation (OGD/R) cell model, Tanshinone IIA also inhibited the expression of inflammatory factors in neuronal cells and inhibited the occurrence of neuronal apoptosis. In addition, Tanshinone IIA promoted the expression of miR-124-5p. Transfection of miR-124-5p mimic has the same therapeutic effect as Tanshinone IIA and positive therapeutic effect on OGD cells, while transfection of miR-124-5p inhibitor has the opposite effect. The targeting of miR-124-5p negatively regulates FoxO1 expression. Inhibition of miR-124-5p or overexpression of FoxO1 can weaken the inhibitory effect of Tanshinone IIA on brain injury induced by I/R, while inhibition of miR-124-5p and overexpression of FoxO1 can further weaken the effect of Tanshinone IIA. Tanshinone IIA alleviates ischemic-reperfusion brain injury by inhibiting neuroinflammation through the miR-124-5p/FoxO1 axis. This finding provides a theoretical basis for mechanistic research on cerebral ischemia-reperfusion injury.