This study aims to investigate the efficacy and possible mechanisms of melatonin in treating interstitial cystitis (IC), as melatonin is involved in anti-inflammatory and immunomodulatory effects and plays an important role in neuroprotection. IC was induced by intraperitoneal injection of cyclophosphamide (CP) with melatonin pretreatment or vehicle pretreatment. On day 7, the voiding behaviors were observed. Bladders were harvested for histologic examination, analysis of the expressions of heme oxygenase-1 (HO-1) and inducible nitric oxide synthase (iNOS) by Western blotting, and also processed for immunohistochemical staining of substance P (SP). Proinflammatory cytokines were measured by ELISA immunoassays. L6-S1 spinal cords were harvested for measurement of SP by radioimmunoassay. CP injection resulted in severe cystitis with increase in voiding behaviors, histological damage, mast cell proliferation, SP, and proinflammatory cytokine expression, which were significantly downregulated by melatonin pretreatment. Pretreatment with melatonin further enhanced the expression of HO-1 and significantly reduced iNOS expression. Melatonin significantly improved bladder symptoms and histological damages in rats with CP-induced cystitis by diminishing bladder oxidative stress, blocking iNOS, upregulation of HO-1, and downregulating the expression of SP.