Approximately 50% of patients with chronic neuropathic pain experience cognitive impairment, which negatively impacts their quality of life. The cannabinoid type 2 receptor (CB2R) may be involved in hippocampal cognitive processes. However, its role in chronic neuropathic pain-induced cognitive impairment remains elusive. Spared nerve injury (SNI) was used to induce chronic neuropathic pain in rats, while the novel-object recognition test and the Y-maze test were employed to assess cognitive function. Immunofluorescence, western blotting, and stereotaxic hippocampal microinjection were utilized to elucidate the potential mechanisms. We observed a reduction in mechanical pain threshold and cognitive impairment in SNI rats. This was accompanied by a tendency for hippocampal microglia to adopt pro-inflammatory functions. Notably, no changes were detected in CB2R expression. However, downregulation of the endogenous ligands AEA and 2-AG was evident. Hippocampal microinjection of a CB2R agonist mitigated cognitive impairment in SNI rats, which correlated with a tendency for microglia to adopt anti-inflammatory functions. Additionally, SNI-induced activation of the p-ERK/NFκB pathway in the hippocampus. Activation of CB2R reversed this process by upregulating DUSP6 expression in microglia. The effects elicited by CB2R activation could be inhibited through the downregulation of microglial DUSP6 via hippocampal adeno-associated virus (AAV) microinjection. Conversely, overexpression of hippocampal DUSP6 using AAV ameliorated the cognitive deficits observed in SNI rats, which remained unaffected by the administration of a CB2R antagonist. Our findings demonstrate that activation of hippocampal CB2R can mitigate chronic neuropathic pain-induced cognitive impairment through the modulation of the DUSP6/ERK/NFκB pathway.