The aim of the study was to examine whether parents' increased postnatal depressive symptoms predicted children's academic attainment over time and whether the parentchild relationship, children's prior academic attainment, and mental health mediated this association. We conducted secondary analyses on the Avon Longitudinal Study of Parents and Children data (12,607 mothers, 9,456 fathers). Each parent completed the Edinburgh-Postnatal Depression Scale at 8 weeks after the child's birth (predictor) and a questionnaire about the mother-child and father-child relationship at 7 years and 1 month (mediator). The children's mental health problems were assessed with the teacher version of the Strengths and Difficulties Questionnaire at 10-11 years (mediator). We used data on the children's academic attainment on UK Key Stage 1 (5-7 years; mediator) and Key Stage 4 (General Certificate of Secondary Education 16 years) (outcome). We adjusted for the parents' education, and child gender and cognitive ability. The results revealed that parents' depressive symptoms at 8 weeks predicted lower academic performance in children at 16 years. Mothers' postnatal depressive symptoms had an indirect effect through children's mental health problems on academic outcomes at 16 years via negative mother-child relationship, and prior academic attainment. There was a significant negative indirect effect of fathers' postnatal depressive symptoms on academic attainment at 16 years via negative father-child relationship on child mental health. The findings suggest that the family environment (parental mental health and parent-child relationship) and children's mental health should be potential targets for support programmes for children of depressed parents.