Objective To assess the association between sleep irregularity, anxiety, and depression while controlling for other sleep dimensions and using a longitudinal design. Methods Longitudinal cohort study which started in April 2020 during the first French lockdown in the general population. Follow-up questionnaires were completed in June 2020, a period without lockdown measures. Participants were asked about their sleep (regularity, duration, timing, complaints) and their anxiety (General Anxiety Disorder-7) and depressive (Patient Health Questionnaire-9) symptoms. Results A total of 3745 participants were included (mean age: 28.9 years) with 2945 women (78.6%). At baseline, 38.1% (1428) of participants reported irregular sleep timing, 23.8% (891) anxiety and 28.9% (1081) depressive symptoms. In cross-sectional analyses, irregular sleep timing was associated with a 2.5-fold higher likelihood of anxiety and a 4-fold higher likelihood of depressive symptoms compared to regular sleepers. Associations were not explained by the other sleep dimensions and persisted in a longitudinal analysis, with irregular sleep timing at baseline being associated with anxiety (OR = 3.27[1.58–6.76]) and depressive symptoms (OR = 3.45[1.66–7.19]) during follow-up. Conclusion The results show a strong association between sleep irregularity and mental health. Furthers studies are needed to explore how sleep regularity could promote good mental health in non-clinical populations.