The occurrence and development of HIV-associated neurocognitive disorders (HAND) is related to synaptic injury and neuron loss, which gradually reduces the ability of learning and memory, and eventually leads to cognitive dysfunction. Human immunodeficiency virus type 1 (HIV-1) enveloped glycoprotein 120 (GP120) is the principal etiological agent of HIV-1-induced nerve damage and HAND. Our previous study demonstrated that GP120 can induce neuronal damage by increasing N-methyl-D-aspartic acid receptor (NMDAR) mediated excitatory postsynaptic currents (EPSCsNMDAR), In addition to neuroexcitotoxicity, the inflammatory response, oxidative stress, and neuronal apoptosis mediated by NMDAR overactivation are also involved in HAND. Because cannabinoids have known effects against neuroinflammation, stress response, and oxidative effects, we researched the effects of the cannabinoid receptor agonist Win55,212–2 [(R)-(+)-[2,3-dihydro-5-methyl-3 [(4-morpholinyl) methyl] pyrrolo [1,2,3-de]− 1,4-benzoxazinyl]-(1-naphthalenyl) methanone mesylate salt] on synaptic changes induced by GP120. In this study, we discovered that Win55,212–2 prevents GP120-induced neurological injury and cognitive dysfunction, and these effects are consistent with the neuroprotective effect of NMDAR blockers. In the Morris water maze (MWM) test, the results revealed that GP120 could induce learning and memory impairment in rats, while antagonizing NMDARs or activating CB2R could counteract GP120-induced cognitive dysfunction in rats; The results of TUNEL staining were consistent with the above results of MWM behavioral experiments. GP120 damaged hippocampal neurons in the CA1 region, while the NMDAR antagonist and cannabinoid 2 receptor (CB2R) agonist prevented GP120-induced effects. In molecular biology experiments, Our results showed that GP120 significantly upregulated the mRNA expressions of inflammatory factors IL-1β, IL-6, TNF-α and CXCL10; Furthermore, GP120 significantly upregulated the protein expression level of pro-inflammatory cytokine IL-1β and decreased the protein expression level of anti-inflammatory cytokine IL-10 as measured by ELISA. Additionally, in the GP120 group, the mRNA expression levels of pro-apoptosis factors such as Bax, CytC, and caspase-3, − 8 and − 9 were significantly increased while the expression level of anti-apoptotic factors Bcl-2 was significantly decreased (P < 0.05). Our studie also demonstrated that the mRNA expression levels of apoptotic pathway factors could be regulated by the p38 JNK MAPK pathway. But pretreatment with NMDAR antagonist memantine or CB2R agonist Win55,212–2 significantly reduced the expression levels of inflammatory factors and apoptotic factors. And the effects aroused by Win55,212–2 could be reversed by the CB2R antagonist AM630. These data suggest that the activation of the CB2R is neuroprotective against GP120-induced neurotoxicity, and CB2R agonist might play a potential therapeutic role in HAND.