Inflammatory reaction plays a key role in the pathogenesis of hypoxic-ischemic encephalopathy (HIE) in neonates. Microglia are resident innate immune cells in the central nervous system and are profoundly involved in neuroinflammation. Studies have revealed that atorvastatin exerts a neuroprotective effect by regulating neuroinflammation in adult animal models of brain stroke and traumatic brain injury, but its role regarding damage to the developing brain remains unclear. This study aimed to clarify the effect and mechanism of atorvastatin on the regulation of microglia function in neonatal hypoxic-ischemic brain damage (HIBD). The oxygen glucose deprivation (OGD) of microglia and neonatal rat HIBD model was established. Atorvastatin, recombinant sclerostin protein (SOST), and XAV939 (degradation of β-catenin) were administered to OGD microglia and HIBD rats. The pathological changes of brain tissue, cerebral infarction volume, learning and memory ability of rats, pro-inflammatory (CD16+/Iba1+) and anti-inflammatory (CD206+/Iba1+) microglia markers, inflammation-related indicators (Inos, Tnfα, Il6, Arg1, Tgfb, and Mrc1), and Wnt/β-catenin signaling molecules were examined. Atorvastatin reduced OGD-induced pro-inflammatory microglia and pro-inflammatory factors, while increasing anti-inflammatory microglia and anti-inflammatory factors. In vivo, atorvastatin attenuated hypoxia-ischemia (HI)-induced neuroinflammation and brain damage. Mechanistically, atorvastatin decreased SOST expression and activated the Wnt/β-catenin signaling pathway, and the administration of recombinant SOST protein or XAV939 inhibited Wnt/β-catenin signaling and attenuated the anti-inflammatory effect of atorvastatin. Atorvastatin promotes the pro/anti-inflammatory phenotypic transformation of microglia via the Wnt/β-catenin pathway in HI neonatal rats. Atorvastatin may be developed as a potent agent for the treatment of HIE in neonates.