Sleep and pain are thought to be bidirectional related on a daily basis in adolescents with chronic pain complaints. In addition, sleep problems have been shown to predict the long-term onset of musculoskeletal pain in middle-aged adults. Yet, the long-term effects of sleep problems on pain duration and different types of pain severity in emerging adults (age: 18-25) are unknown. This study investigated the cross-sectional and longitudinal relationship between sleep problems and chronic pain, and musculoskeletal pain, headache, and abdominal pain severity in a general population of emerging adults. We studied whether these relationships were moderated by sex and whether symptoms of anxiety and depression, fatigue, or physical inactivity mediated these effects. Data of participants from the longitudinal Dutch TRacking Adolescents' Individual Lives Survey were used. Follow-up data were collected in 1753 participants who participated in the fourth (N = 1668, mean age: 19.0 years [SD = 0.6]) and/or fifth (N = 1501, mean age: 22.3 years [SD = 0.6]) assessment wave. Autoregressive cross-lagged models were used for analyses. Sleep problems were associated with chronic pain, musculoskeletal pain, headache and abdominal pain severity, and predicted chronic pain and an increase in musculoskeletal pain severity at 3 years of follow-up. This prospective effect was stronger in females than in males and was mediated by fatigue but not by symptoms of anxiety and depression or physical inactivity. Only abdominal pain had a small long-term effect on sleep problems. Our results suggest that sleep problems may be an additional target for treatment in female emerging adults with musculoskeletal pain complaints.