The Rho kinase inhibitor fasudil exerts neuroprotective effects. We previously showed that fasudil can regulate M1/M2 microglia polarization and inhibit neuroinflammation. Here, the therapeutic effect of fasudil on cerebral ischemia‑reperfusion (I/R) injury was investigated using the middle cerebral artery occlusion and reperfusion (MCAO/R) model in Sprague‑Dawley rats. The effect of fasudil on the phenotype of microglia and neurotrophic factors in the I/R brain and its potential molecular mechanism was also explored. It was found that fasudil ameliorated neurological deficits, neuronal apoptosis, and inflammatory response in rats with cerebral I/R injury. Fasudil also promoted the polarization of microglia into the M2 phenotype, in turn promoting the secretion of neurotrophic factors. Furthermore, fasudil significantly inhibited the expression of TLR4 and NF‑κB. These findings suggest that fasudil could inhibit the neuroinflammatory response and reduce brain injury after I/R injury by regulating the shift of microglia from an inflammatory M1 phenotype to an anti‑inflammatory M2 phenotype, which may be related to the regulation of the TLR4/ NF‑κB signal pathway.