Abstract: Objective To explore the effects and therapeutic mechanism of electroacupuncture on the levels of polarization markers and inflammatory factors interleukin (IL)-6, IL-4, tumor necrosis factor-alpha (TNF-α), and IL-10 in rats with para-chlorophenylalanine-induced insomnia (PCPA). Methods Fifty healthy specific-pathogen free grade Sprague-Dawley rats, half male and half female, were randomly divided into a blank group (n=10) and a model reserve group (n=40), in which insomnia was induced by intraperitoneal injection of a 500 mg/kg PCPA suspension. Using the random number table method, the 30 successfully modeled rats were divided into three treatment groups of 10 rats/group: model, electroacupuncture, and estazolam. The estazolam group was given estazolam 0.2 mg/(kg·d) by gavage; the electroacupuncture group was given once-daily electroacupuncture at the “Shenmen” and “Sanyinjiao” acupoints, and stimulation at the “Baihui” and “Benshen” acupoints, 20 minutes each time, for 7 consecutive days. Following treatment, serum and hypothalamic levels of TNF-α, IL-6, IL-4, and IL-10 were detected using ELISA and Western blot, while immunofluorescence staining was used to detect the presence of Iba-1 in hypothalamic microglia and the co-expression of CD86 and CD163, which are markers for the M1 and M2 subtypes of microglial cells, respectively. Results Compared with the blank group, the model group exhibited prolonged sleep latency (SL) (P<0.01), shortened sleep duration (ST) (P<0.05), significantly higher serum and hypothalamic protein levels of IL-6 and TNF-α (P<0.01), and significantly lower levels of IL-4 and IL-10 (P<0.01). Compared with the model group, the electroacupuncture and estazolam groups exhibited significantly shorter SL (P<0.01), prolonged ST (P<0.01), significantly lower serum and hypothalamic protein levels of IL-6 and TNFα (P<0.01), and significantly higher IL-4 and IL-10 levels (P<0.01). IL-6 content was lower in the electroacupuncture group than in the estazolam group (P<0.05). Compared with the blank group, the model group exhibited significantly enhanced Iba-1/CD86 (M1 type) co-expression (P<0.01) alongside significantly weakened Iba-1/CD163 (M2 type) co-expression (P<0.01). Under electroacupuncture or estazolam intervention, Iba-1/CD86 co-expression was significantly weakened (P<0.01), and Iba-1/CD163 co-expression was significantly enhanced in the model group (P<0.05). Conclusions Electroacupuncture effectively improved sleep disturbances in rats, with an underlying mechanism that may involve regulation of microglial polarization, downregulation of pro-inflammatory cytokine levels, upregulation of anti-inflammatory cytokine levels, and alleviation of neuroinflammation, thereby ameliorating sleep.