Previous studies had shown that pretreatment with midazolam inhibited morphine-induced tolerance and dependence. The present study was to investigate the role of spinal nitric oxide (NO) in the inhibitory effect of midazolam on the development of morphine-induced analgesia tolerance. Subcutaneous injection of 100 mg/kg morphine to mice caused an acute morphine-induced analgesia tolerance model. To develop chronic morphine tolerance in mice, morphine was injected for three consecutive days (10, 20, 50 mg/kg sc on Day 1, 2, 3, respectively). In order to develop chronic tolerance model in rats, 10 mg/kg of morphine was given twice daily at 12 h intervals for 10 days. Midazolam was intraperitoneally injected 30 min prior to administration of morphine. Tail-flick test, hot-plate and formalin test were conducted to assess the nociceptive response. Immunocytochemistry, histochemistry and western blot were performed to determine the effect of midazolam on formalin-induced expression of Fos protein, nicotinamide adenine dinucleotide phosphate-diaphorase (NADPH-d) and nitric oxide synthase (NOS) in chronic morphine-tolerant rats, respectively. The results showed that pretreatment with midazolam significantly inhibited the development of acute and chronic morphine tolerance in mice, which could be partially reversed by intrathecal injection of NO precursor L-arginine (L-Arg). In chronic morphine-tolerant rats, pretreatment with midazolam significantly decreased the formalin-induced expression of Fos and Fos/NADPH-d double-labeled neurons in the contralateral spinal cord and NADPH-d positive neurons in the bilateral spinal cord. Both inducible NOS (iNOS) and neuronal NOS (nNOS) protein levels in the spinal cord were significantly increased after injection of formalin, which could be inhibited by pretreatment with midazolam. The above results suggested that the decrease of the activity and expression of NOS contributed to the inhibitory effect of midazolam on the development of morphine tolerance.