BackgroundLow socioeconomic position in childhood is associated with greater cardiometabolic disease risk later in life. The aim of the current study is to examine the mediating impact of mental health on the association between childhood socioeconomic position and cardiometabolic disease risk in young adulthood.MethodsWe used a combination of national registers, longitudinal questionnaire-data and clinical measurements from a sub-sample (N = 259) of a Danish youth cohort. Childhood socioeconomic position was indicated by the educational level of the mother and the father at age 14. Mental health was measured by four different symptom scales at four age-points (age 15, 18, 21 and 28), and combined into one global score. Cardiometabolic disease risk was measured by nine biomarkers at age 28–30 and combined into one global score by sample-specific z-scores. We conducted analyses within the causal inference framework and evaluated the associations using nested counterfactuals.ResultsWe found an inverse association between childhood socioeconomic position and cardiometabolic disease risk in young adulthood. The proportion of the association which was mediated by mental health was 10 (95% CI: -4; 24) % and 12 (95% CI: -4; 28) % using educational level of the mother and the father as indicator, respectively.ConclusionsAccumulated poorer mental health in childhood, youth and early adulthood partially explained the association between low childhood socioeconomic position and increased cardiometabolic disease risk in young adulthood. The results of the causal inference analyses rely on the underlying assumptions and correct depiction of the DAG. Since these are not all testable, we cannot exclude violations that potentially could bias the estimates. If the findings can be replicated, this would support a causal relationship and direct potentials for intervention. However, the findings point to a potential for intervention in young age in order to impede the translation of childhood social stratification into later cardiometabolic disease risk disparities.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-023-15942-y.