Background: The diterpenoid cryptotanshinone (CTS) has wide biological functions, including inhibition of tumor growth, inflammation and apoptosis. The present study aimed to explore the possible effect of CTS on cerebral ischemia/reperfusion (I/R) injury and the underlying mechanisms. Methods: Male C57BL/6J mice underwent transient middle cerebral artery occlusion (tMCAO) and murine microglia BV2 cells were challenged by Oxygen/glucose deprivation, to mimic I/R and ischemic/hypoxic and reperfusion (H/R) injury, respectively. CTS was administered 0.5 h (10 mg/kg) after the onset of MCAO or 2 h (20 mu M) post OGD. Infarct volume and neurological deficit were measured. Immunofluorescence, qPCR, and western blot, were performed to detect the expression of cytokines, apoptotic marker, and M1/M2 phenotype-specific genes. Flow cytometry was applied for M1/M2 subpopulation or Annexin V/PI apoptosis assessment. Results: CTS significantly reduced cerebral infarct volume, neurologic deficit scores, pro-inflammatory cytokine production (IL-6, TNF-alpha, and IL-1 beta), apoptotic protein expression (cleaved caspase-3) of mice after tMCAO challenge. Furthermore, CTS attenuated CD16(+) M1-type and elevated CD206(+) M2-type microglia in vivo or in vitro. Conclusions: We propose that the neuroprotective effect of CTS in the I/R or H/R context are explained modulation of microglial polarization, suggesting therapeutic potential for cerebral ischemic stroke.