Microglia can be activated to become the classic phenotype (M1) or alternative phenotype (M2), which play an important role in regulating neuroinflammatory response and tissue repair after ischemic stroke. CD21, a novel phthalide derivative, is a potential neuroprotectant against ischemic brain injury. The present study further investigated the effects of CD21 on post-ischemic microglial polarization and the underlying mechanisms. Transient middle cerebral artery occlusion (tMCAO) was used as a mouse model of ischemic stroke, while BV2 cells stimulated with conditioned medium collected from oxygen-glucose deprivation-treated HT22 cells were used in in vitro ischemic studies. The current results showed that CD21 dose-dependently and significantly improved neurological outcomes in tMCAO mice. Biochemical analyses revealed that CD21 decreased the expression of M1 phenotype markers (CD86, interleukin-1β and inducible nitric oxide synthase) and increased the expression of M2 phenotype markers (CD206, interleukin-10 and YM1/2) in both ischemic brain tissues and BV2 cells. Meanwhile, CD21 decreased the production of proinflammatory cytokines (interleukin-1β, interleukin-6 and tumor necrosis factor-α), promoted the release of the antiinflammatory cytokine (interleukin-10), and enhanced the phosphorylation of adenosine 5′-monophosphate-activated protein kinase (AMPK) in ischemic brain tissue and BV2 cells. Furthermore, the AMPK inhibitor (compound C) reversed these effects of CD21 in BV2 cells. These findings indicate that CD21 alleviates post-ischemic neuroinflammation through induction of microglial M2 polarization that is at least in part medicated by AMPK activation, suggesting that CD21 may be a promising candidate for protecting against ischemic brain injury.