The inflammatory-associated factors interleukin-1β (IL-1β), interleukin-6 (IL-6) and tumor necrosis factor-α (TNF-α) are widely reported to be associated with intervertebral disc (IVD) degeneration (IVDD). N-acetyl-5-methoxytryptamine (melatonin) is a natural hormone secreted by the pineal gland which has been shown to participate in several physiological and pathological progresses, such as aging, anti-inflammation, anti-apoptosis and autophagy regulation. However, the effects of melatonin on IVD remain unclear. In the present study, we treated human nucleus pulposus cells (NPCs) with melatonin and discovered that melatonin could modulate extracellular matrix (ECM) remodeling induced by IL-1β by enhancing collagen II and aggrecan expression levels and by downregulating matrix metalloproteinase-3 (MMP-3) levels. These findings were verified by western blot and immunofluorescence assays. Intraperitoneal injection of melatonin mitigated IVDD in the rat tail puncture model. X-ray and magnetic resonance imaging (MRI), as well as hematoxylin-eosin (H&E), Safranine O-Green, Alcian blue and Celium red staining methods were adopted to evaluate IVDD grades, the structural integrity of nucleus pulposus (NP) and annulus fibrosus (AF) and the damage and calcification of the cartilage endplate. Melatonin reduced inflammatory cell aggregation and the release of the inflammatory factors IL-1β, IL-6, TNF-α as determined by immunohistochemistry. In conclusion, the present study demonstrated that melatonin could modulate ECM remodeling by IL-1β in vitro and attenuate the IVDD and induction of inflammation in a rat tail puncture model in vivo. The data demonstrated that melatonin may contribute to the restoration processs of IVD following damage and may be used as a potential novel therapy for IVDD.