Cognitive impairment is one of the most common complications associated with chronic pain. Almost 20% of chronic pain patients suffer from cognitive impairment, which may substantially influence their quality of life. Levels of major excitatory neurotransmitters in the central nervous system and alterations in the glutamatergic system may influence cognitive function and the pain sensory pathway. In this study, we adopted the spared nerve injury model to establish the progress of chronic pain and investigated the mechanism underlying the cognitive aspect related to it. At behavioral level, using the novel-object recognition test, mechanical hypersensitivity was observed in peripheral nerve-injured rats because they exhibited recognition deficits. We showed a dramatic decrease in hippocampal glutamate concentration using nuclear magnetic resonance and reduced glutamatergic synaptic transmission using whole-cell recordings. These were associated with deficient hippocampal long-term potentiation induced by high-frequency stimulation of the Schaffer collateral afferent. Ultra-high-performance liquid chromatography revealed lower levels of D-serine in the hippocampus of the spared nerve injury rats and that D-serine treatment could restore synaptic plasticity and cognitive dysfunction. The reduction of excitatory synapses was also increased by administering D-serine. These findings suggest that chronic pain has a critical effect on synaptic plasticity linked to cognitive function and may built up a new target for the development of cognitive impairment under chronic pain conditions.