Melatonin is a ubiquitously distributed molecule that possesses diverse functions. Melatonin plays a key role in the endogenous circadian rhythms of humans via light stimulation in the hypothalamus. In addition, melatonin has roles in the opioid system, the nitric oxide pathway, free radical scavenging, inflammation, and antinociception. Melatonin is nontoxic and relatively safe. Recently, exogenous melatonin has been shown to have significant effects in the treatment of migraine. Further, it has demonstrated efficacy in the treatment of sleep disorders, including insomnia, circadian rhythm sleep-wake disorders, parasomnias, and sleep breathing disorders. Sleep disorders are commonly reported by those who experience migraine, and migraine and sleep disorders have been reported to be closely associated in cross-sectional studies. Longitudinal studies have shown that some sleep disorders and migraine show bidirectional comorbidities. Therefore, the identification and treatment of sleep disorders is important when treating migraine. Melatonin represents a promising treatment strategy for both disorders, especially when these conditions are combined.