Abstract: Objective To explore the effects of electroacupuncture on synaptic plasticity and microglial polarization and detect the expression of miR-21 / signal transducer and activator of transcription 3 (STAT3) pathway in rats with cerebral ischemia. Methods The distal end of the external carotid artery was double-ligated with a thin wire for 60 minutes to establish a rat model of focal cerebral ischemia. The neurological deficit score was used to evaluate the model preparation. The successful model rats were divided into a model group, electroacupuncture group, and nimodipine group.The control group comprised rats treated by a sham operation. After 3 weeks of treatment, the cerebral infarction volume was measured by 2,3,5-triphenyltetrazolium chloride staining, the synapse ultrastructure was observed by electron microscopy and analyzed by morphometry, and the microglial polarization was assessed by immunofluorescence staining. Additionally, the level of miR-21 in the cerebral cortex of rats in each group was measured by real-time fluorescence quantitative polymerase chain reaction, and western blotting was used to detect the levels of Janus kinase 2 (JAK2), p-JAK2, STAT3, and p-STAT3 in the cerebral cortex of rats in each group. Results The neurological deficit score, cerebral infarction volume, number of M1 microglia, and levels of miR-21, p-STAT3, and p-JAK2 were significantly higher and the number of M2 microglia, numerical density of synapsis (Nv ), volume density of synapsis (Vv ), surface density of synapsis ( Sv ), postsynaptic density (PSD), synaptic curvature, and width of the synaptic cleft were significantly lower in the model group than in the control group (P< 0. 05). The neurological deficit score, cerebral infarction volume, number of M1 microglia, and levels of miR-21, p-STAT3, and p-JAK2 were significantly lower and the number of M2 microglia, Nv, Vv, Sv, PSD, synaptic curvature, and width of the synaptic cleft were significantly higher in the electroacupuncture group and nimodipine group than in the model group (P<0. 05). Conclusions Electroacupuncture can promote synaptic remodeling and induce microglial polarization from M1 to M2 in rats with focal cerebral ischemia.