Pain is one of the most common medical challenges, reducing life quality. Despite the progression in pain management, it has remained a clinical challenge, which raises the need for investigating novel antinociceptive drugs with correspondence signaling pathways. Besides, the precise antinociceptive mechanisms of melatonin are not revealed. Accordingly, owing to the critical role of L-arginine/nitric oxide (NO)/cyclic GMP (cGMP)/K ATP in the antinociceptive responses of various analgesics, the role of this signaling pathway is evaluated in the antinociceptive effects of melatonin. Male NMRI mice were intraperitoneally pretreated with the injection of L-arginine (NO precursor, 100 mg/kg), N(gamma)-nitro-L-arginine methyl ester [L-NAME, NO synthase (NOS) inhibitor, 30 mg/kg], S-nitroso-N-acetylpenicillamine (SNAP, NO donor, 1 mg/kg), sildenafil (phosphodiesterase inhibitor, 0.5 mg/kg), and glibenclamide (K ATP channel blocker, 10 mg/kg) alone and before the administration of the most effective dose of melatonin amongst the intraperitoneal doses of 50, 100, and 150 mg/kg. The formalin test (2%, 25 µL, intra-plantarly) was done following the melatonin administration, then the nociceptive responses of mice were evaluated during the early phase for 5 min and the late phase for 15 min. The results showed that 100 mg/kg dose of melatonin carried out the most antinociceptive effects. While the antinociceptive effect of melatonin was increased by L-arginine, SNAP, and sildenafil, it was significantly reduced by L-NAME and glibenclamide in both phases of the formalin test, with no relation to the sedative effects of melatonin evaluated by the inclined plane test. In conclusion, the antinociceptive effect of melatonin is mediated through the L-arginine/NO/cGMP/K ATP pathway.