Importance The menopausal transition has been associated with an increased risk of depression, although findings are inconsistent. While most research has focused on menopausal stage, some studies suggest that later age at menopause may be associated with lower depression risk. Objective To examine the association between age at menopause and depression risk during perimenopause and early postmenopause using multivariable regression and genetic approaches. Design Prospective cohort study using data from the mothers of the Avon Longitudinal Study of Parents and Children (ALSPAC), a UK birth cohort that recruited pregnant women in 1991-1992. Setting UK community-based cohort study. Participants Up to 3,307 women with repeated measures of depressive symptoms across the perimenopausal and postmenopausal periods and data on observed or genetically predicted age at menopause. Exposure Observed age at menopause, a polygenic risk score (PRS) for age at menopause, and genetically predicted age at menopause. Main Outcome(s) and Measure(s) Depressive symptoms during the perimenopausal and early postmenopausal periods were assessed using the Edinburgh Postnatal Depression Scale (EPDS), with depression defined as a score >= 13. Results Effect estimates across multivariable regression and genetic analyses were small and directionally consistent with lower odds of depression with older age at menopause, although most confidence intervals included the null. In analyses using observed age at menopause, there was little evidence of an association with depression during perimenopause (Odds ratio (OR) per year increase in age at menopause 0.98, 95%CI 0.89-1.08) or postmenopause (OR 1.00, 95%CI 0.89-1.13). Results were similar when using a PRS as a genetic proxy for age at menopause during perimenopause (OR per standard deviation (SD) increase in PRS 0.98, 95%CI 0.89-1.09) but suggested lower odds of depression during postmenopause (OR 0.92, 95%CI 0.86-0.99). Mendelian randomization analyses did not support a causal effect (OR per year increase 1.00, 95%CI 0.89-1.13 for perimenopause, and OR 0.97, 95%CI 0.86-1.09 for postmenopause). Conclusions and Relevance Age at menopause is unlikely to be a major driver of midlife depression risk. However, consistent effect directions across approaches suggest a small association may exist, but further research in larger samples is needed to confirm this.