To model and test direct and indirect pathways connecting general cognitive ability (g) with cardiovascular disease risk factors, via socioeconomic status (SES) and multiple health behaviors. A sample comprising participants in the Health and Lifestyle Survey, a prospective cohort study of a representative sample of U.K. adults in 1984/5 (n = 4939, 2426 males). Two mediating latent variables were proposed that connected a latent cognitive trait (named g) with a latent trait of cardiovascular disease (CVD) risk: multiple health behaviors (defined by smoking, physical inactivity, and weekly saturated fat intake) and SES (defined by educational attainment, occupational social class, and income). In males and females, SES mediated the association between g and CVD risk, but the mediation was moderated by years of age. A direct effect from g to CVD risk was also significant, but this was restricted to older males. Multiple health behaviors offered no explanatory power, because they were not influenced by g. SES may connect g with CVD risk in males, but not systematically across the life course. Moderated mediation is a novel way to illustrate that direct and indirect pathways can vary as a function of age. Explanations that emphasize g or SES are not mutually exclusive; there are direct and indirect contributions to CVD risk from each source, and these vary across the life course.