Noxious stimulus and painful experience in early life can induce cognitive deficits and abnormal pain sensitivity. As a major component of the outer membrane of gram-negative bacteria, lipopolysaccharide (LPS) injection mimics clinical symptoms of bacterial infections. Spinal microglial activation and the production of pro-inflammatory cytokines have been implicated in the pathogenesis of LPS-induced hyperalgesia in neonatal rats. Dexmedetomidine (DEX) possesses potent anti-neuroinflammatory and neuroprotective properties through the inhibition of microglial activation and microglial polarization toward pro-inflammatory (M1) phenotype and has been widely used in pediatric clinical practice. However, little is known about the effects of DEX on LPS-induced spinal inflammation and hyperalgesia in neonates. Here, we investigated whether systemic LPS exposure has persistent effects on spinal inflammation and hyperalgesia in neonatal rats and explored the protective role of DEX in adverse effects caused by LPS injection. Systemic LPS injections induced acute mechanical hyperalgesia, increased levels of pro-inflammatory cytokines in serum, and short-term increased expressions of pro-inflammatory cytokines and M1 microglial markers in the spinal cord of neonatal rats. Pretreatment with DEX significantly decreased inflammation and alleviated mechanical hyperalgesia induced by LPS. The inhibition of M1 microglial polarization and microglial pro-inflammatory cytokines expression in the spinal cord may implicate its neuroprotective effect, which highlights a new therapeutic target in the treatment of infection-induced hyperalgesia in neonates and preterm infants.