Introduction: Sleep disturbances are known to impact mental and physical health. In cross-sectional population studies, adverse childhood experiences (ACEs) associate with sleep problems (SPs), with potential variations by sex. In a prospective population study, we tested whether the effect of ACEs on SPs differs between males and females. Method: In a Finnish population-based study, 3142 individuals aged 30-64 years (56 % female) completed questionnaires about ACEs in 2000 and SPs in 2000 and in 2011. The effects of ACEs on SPs were analysed using repeated measures ANOVA and path analyses. Results: Multiple ACEs associated with subjective SPs in adulthood, even after controlling for sex, age, marital status, education, income, smoking, alcohol abuse, chronic illness, and continuous pain. Of the ACE dimensions, social disadvantage was associated with SPs in both sexes. The effects of multiple ACEs and social disadvantage on SPs were partially mediated by affective symptoms, depression and anxiety. Family conflicts and maternal mental health problems associated with SPs only in females, and this association was also mediated via affective symptoms. Conclusion: ACEs, especially social disadvantage, are associated with SPs in the adult general population. This prospective study suggests sex differences in the observed associations. Specifically, family conflicts and maternal mental health problems associate with SPs in females only, with the affective symptom domain as the main mediator. For effective treatment of long-term SPs, it is important to investigate patients' childhood living conditions and their childhood family's emotional atmosphere. Childhood psychological distress requires attention particularly in females.