Study objective: The temporal relationships among sleep, depressive symptoms, and pain are unclear. This longitudinal study examines whether insomnia and sleep duration predict the onset of chronic multisite musculoskeletal pain over 6 years and whether this association is mediated by depressive symptoms. Methods: 1860 subjects of the Netherlands Study of Depression and Anxiety, free from chronic multisite musculoskeletal pain at baseline, were followed up for the onset of chronic multisite musculoskeletal pain over 6 years (Chronic Pain Grade Questionnaire). We determined baseline insomnia (Women's Health Initiative Insomnia Rating Scale ≥9) and sleep duration (short: ≤6 hr, normal: 7-9 hr, long: ≥10 hr). Depressive symptoms were assessed at baseline and as a change score over time (Inventory of Depressive Symptomatology). Results: Insomnia (hazard ratio [HR] [95% confidence interval, 95%CI] = 1.60 [1.30-1.96], p < .001) and short sleep duration (HR [95%CI] = 1.52 [1.22-1.90], p < .001) were associated with chronic pain onset. Adding baseline depressive symptoms as a mediator attenuated the associations for insomnia and short sleep with chronic pain onset (ΔB = 40% and 26%, respectively). Adding the change score of depressive symptoms further weakened the association for insomnia (ΔB = 16%) but not for short sleep. All direct effects for sleep measures with chronic pain onset remained statistically significant (p < .05). Conclusions: This longitudinal study shows that insomnia and short sleep duration are risk factors for developing chronic pain. Depressive symptoms partially mediate the effect for insomnia and short sleep with developing chronic pain.