During adolescence, a second period of central nervous system (CNS) plasticity that follows the fetal period, which involves sleep deprivation (SD), becomes apparent. SD during adolescence may result in abnormal development of neural circuits, causing imbalance in neuronal excitation and inhibition, which not only results in pain, but increases the chances of developing emotion disorders in adulthood, such as anxiety and depression. The quantity of surgeries during adolescence is also consistently on the rise, yet the impact and underlying mechanism of preoperative SD on postoperative pain remain unexplored. This study demonstrates that preoperative SD induces upregulation of the P2Y12 receptor, which is exclusively expressed on spinal microglia, and phosphorylation of its downstream signaling pathway p38Mitogen-activated protein/Nuclear transcription factor-κB (p38MAPK/NF-κB)in spinal microglia, thereby promoting microglia activation and microglial transformation into the proinflammatory M1 phenotype, resulting in increased expression of proinflammatory cytokines that exacerbate persisting postoperative incisional pain in adolescent mice. Both intrathecal minocycline (a microglia activation inhibitor) and MRS2395 (a P2Y12 receptor blocker) effectively suppressed microglial activation and proinflammatory cytokine expression. Interestingly, supplementation with dehydrocorydaline (DHC), an extract of Rhizoma Corydalis, inhibited the P2Y12/p38MAPK/NF-κB signaling pathway, microglia activation, and expression of pro-inflammatory cytokines in the model mice. Taken together, the results indicate that the P2Y12 receptor and microglial activation are important factors in persistent postoperative pain caused by preoperative SD in adolescent mice and that DHC has analgesic effects by acting on these targets.