Neuroinflammation can be alleviated via M2 microglia polarization, which could promote the recovery of perimenopausal depression. Astragalin (AST) possesses anti-neuroinflammatory activity. However, the effects of AST on perimenopausal depression and the molecular mechanism in regulating microglia polarization remained unknown. The purpose was to investigate the effects of AST on mice with simulated perimenopausal depression through regulating microglia polarization. It was aimed to clarify the molecular mechanism related to the interleukin-4 receptor (IL-4R)/janus kinase (JAK) 1/signal transducer and activator of transcription (STAT) 6 signaling pathway. The ovariectomy (OVX)/chronic unpredictable mild stress (CUMS)-induced murine model of perimenopausal depression was established and treated with AST. Then the depression-like behaviors and cognitive ability of mice were examined. After that, we detected the markers of microglia polarization and its regulatory signals. In addition, lipopolysaccharides (LPS)/adenosine triphosphate (ATP)-induced inflammatory BV2 model were used to verify the potential molecular mechanism. AST alleviated perimenopausal depression-like behaviors and memory deficits. AST alleviated microglia activation and increased Ki67-positive cells in dentate gyrus (DG). The viability of BV2 decreased by LPS/ATP was raised by AST. Moreover, both in vivo and in vitro, AST switched microglia from M1 phenotype caused by OVX/CUMS or LPS/ATP to M2 phenotype. The IL-4R/JAK1/STAT6 signaling was restored, and the levels of inducible nitric oxide synthase (iNOS), nuclear NF-KappaB-p65 were reduced by AST. Importantly, AST showed prevention against the ubiquitination modification and degradation of STAT6. Our results revealed new insights into molecular mechanism associated with microglia polarization in the effect of AST on the mouse model of perimenopausal depression.