Abstract Background Research on psychological effects of unintended pregnancies that are carried to term presents mixed results, and evidence on long-term associations is scarce. The aim of the current study was to examine effects of unintended pregnancies carried to term on both mothers and children, up to 16 years postpartum. Methods This study is based on the Dutch population-based birth cohort study ‘Amsterdam Born Children and their Development’ (ABCD-study), which included pregnant people in 2003 (n = 7784) and is still following these mothers and their children. Structural Equation Models were analyzed per time-point, examining associations between unintended pregnancy and maternal psychosocial distress, and children’s internalizing- and externalizing problems, while controlling for co-occurring risks. Further, mediating effects via maternal mental health and bonding on children were assessed. Results Around 5 years postpartum, pregnancy mistiming was positively associated to maternal psychological distress. Antenatal psychological distress was a much stronger predictor of maternal psychological distress than unintended pregnancy. Pregnancy mistiming was a significant predictor of internalizing and externalizing problems and unwanted pregnancy of internalizing problems in the children from these pregnancies, around 5 years postpartum. These associations were mostly mediated by maternal mental health and poorer maternal bonding. All associations were no longer present at 12 and 16 years postpartum. Conclusions Unintended pregnancies often coincide with maternal mental health problems, and results showed that associations between unintended pregnancy and both mother’s and children’s psychosocial problems are strongly influenced by maternal mental health. Therefore it is important to improve maternal mental health for the benefit of both mother and child, rather than on the isolated effect of unintended pregnancy. Key messages • Carrying an unintended pregnancy to term impacts psychological health in both mothers and their children up to 5 years but no longer at 12 or 16 years postpartum. • The effects of unintended pregnancy on psychological health in mothers and children are mostly explained by maternal mental health and bonding, so the focus should be on improving these.