As a common clinical disease, neuropathic pain is difficult to be cured with drugs. The occurrence and progression of pain is closely related to the response of spinal microglia. Aspartof the regulation of microglialactivity,PD-L1 playsacriticalrole. Loss of PD-L1 promoted the polarization of M1-like microglia. Increased expression of PD-L1 promoted M2-like polarization. Electroacupuncture has a significant analgesic effect in clinical practice, but its specific mechanism remains to be further explored. In this study, we verified the role of PD-L1 in EA analgesia and the underlying molecular mechanism through spinal nerve ligation (SNL) in rats and lipopolysaccharide (LPS)-treated BV2 microglial cells. Forbehavioralstudiesofrats,mechanical withdrawal threshold (MWT) and thermal withdrawal latency (TWL) were measured, and spinal cord neuros were examined under transmission electron microscopyto determine changes to their myelin structure. The expression levels of PD-L1 and M1/M2-specific markers in rat spinal cord and BV2 microglial cells were measured by enzyme-linked immunosorbent assay, flow cytometry, immunofluorescence staining and Western blot analysis. Our study showed that EA increased the pain threshold, reduced the destruction of myelin structure, promoted the expression of PD-L1 and PD-1, inhibited the MAPK signaling pathway, and promoted the conversion of microglial polarization from the M1 phenotype to the M2 phenotype in SNL rats. PD-L1 knockdown reversed these effects of EA. In addition, PD-L1 knockdown activated the MAPK signaling pathway, promoted microglial polarization to the M1 phenotype, decreased the expression of anti-inflammatory mediators and increased the expression of proinflammatory factors in LPS-stimulated BV2 microglial cells. Our results showed that EA may regulate the excitability of primary afferent neurons through PD-L1 and then inhibit the MAPK signaling pathway to promote the transformation of activated M1 microglia into M2 microglia, reduce inflammatory reactions, and finally achieve analgesic effects. A therapy targeting PD-L1 may be an effective strategy for treating neuropathic pain.