Neuropathic pain (NP) is the chronic pain in patients resulting from injuries or diseases in the somatosensory nervous system. However, effective treatment remains limited to opioids. Currently, there is an urgent need to develop new specific pharmaceuticals with low abuse potentiality. Cannabinoid receptor 2 (CB2R) is one of the significant receptors in the endocannabinoid system. It is widely expressed in the central nervous system, especially enriched in glial cells, and plays an important role in the occurrence and development of inflammation in the nervous system. CB2R activation has a neuroprotective effect on nerve injury. In this study, we report increased and more reactive microglia (with larger cell body, shorter processes, and fewer endpoints) observed in the spinal dorsal horn of spared nerve injury (SNI) rats. Continuous intrathecal administration of CB2R agonist PM226 attenuated mechanical and cold hyperalgesia in rats and prevented the transition of microglia to the proinflammatory stage. Thus, microglia transitioned into the neuroprotective stage. Meanwhile, the proinflammatory factors TNF-α and iNOS decreased, and the levels of anti-inflammatory factors Arg-1 and IL-10 increased. The content of P2X7 receptors in the spinal dorsal horn of rats increases with time after SNI. After continuous intrathecal administration of PM226, the content of P2X7 protein decreases significantly. The administration of P2X7 inhibitor A-438079 alleviated the mechanical hyperalgesia of rats, reduced the number of microglia, and decreased the content of P2X7. These results indicate that P2X7 is involved in the neuroprotective effect caused by CB2R activation. In conclusion, this study provides new insights into the neuroprotective mechanism of CB2R activation.