Oxycodone is a highly prescribed opioid and its abuse has been rampant. Accumulating evidence shows that the cannabinoid CB1 receptor (CB1R) plays a key role in mediating rewarding effects to opioids. However, the downstream signalling of CB1R induced by oxycodone remains unclear. The neuropeptide oxytocin is well known as a potential remedy for drug addiction. Thus, our study aims to explore the mechanism of oxycodone-induced learning and memory deficits underlying the endocannabinoid system (ECS) and the effect of oxytocin. Rats were intraperitoneally injected with oxycodone once a day for eight consecutive day. Novel object recognition, resident-intruder and Morris Water Maze tests were employed to assess the cognitive, social and spatial memory of the rats after oxycodone withdrawal. The (co-)expression of CB1R, cyclin-dependent kinase 5 (Cdk5), regulatory protein p25, tau and phosphorylated tau was measured 1 day after the last behavioural test. The histopathological staining and synaptic density in the hippocampus were observed as well. We found that oxycodone upregulated the expression of p-GSK3β, co-expression of p-Cdk5 and p25 through CB1R. This finding was accompanied by elevation of pSer396, pSer404 in the tau, and reduction of the number of neurons, dendritic spines and synaptic density in the hippocampus. Furthermore, i.c.v. treatment with oxytocin ameliorates memory deficits in oxycodone-treated rats through inhibition of the ECS. We propose further studies on the clinical use of this neuropeptide, which may potentially cure drug addiction.