Background Early life adversity (ELA) is a significant risk factor for mental health disorders. One hypothesised mechanism by which this occurs is via an effect on immune response. In this analysis of epidemiological data, we tested whether ELA was associated with cognitive performance, and if so, whether these effects were influenced by immune function.Methods We investigated the longitudinal relationship between ELA, inflammatory markers, and cognition in data from Avon Longitudinal Study of Parents And Children (ALSPAC; n similar to 5000). ELA was defined in terms of physical/emotional abuse, harsh parenting, or domestic violence before 5 years. Social cognition was measured in terms of theory of mind, and general cognitive ability was measured using IQ. Inflammatory markers included serum C-reactive protein and interleukin-6 levels.Results A significant association was observed between IQ and harsh parenting, whereby children who were physically disciplined had lower IQ scores (accounting for relevant social factors). Both immune markers were associated with variation in cognition, however, neither accounted for the effects of ELA on cognition.Discussion This study highlights the impact of ELA on cognition. In the absence of evidence that these effects are explained by inflammation, other mechanisms by which the effects of ELA are mediated are discussed.