Late-life inflammation has been linked to dementia risk and preclinical cognitive decline, but less is known about early adult inflammation and whether this could influence cognition in midlife. We aimed to identify inflammation levels through early adulthood and determine association of these trajectories with midlife cognition. We used data from the Coronary Artery Risk Development in Young Adults study to identify inflammation trajectories (C-reactive protein [CRP] level <10 mg/L) over 18 years through early adulthood (age range 24-58) in latent class analysis and to assess associations with cognition 5 years after the last CRP measurement (age range 47-63). Six cognitive domains were evaluated from tests of verbal memory, processing speed, executive function, verbal and category fluency, and global cognition; poor cognitive performance was defined as a decline of ≥1 SD less than the mean on each domain. The primary outcome was poor cognitive performance. Logistic regression was used to adjust for demographics, smoking, alcohol use, physical activity, and APOE 4 status. Among 2,364 participants, the mean (SD) age was 50.2 (3.5) years; 55% were female, and 57% were White. Three CRP trajectories emerged over 18 years: lower stable (45%), moderate/increasing (16%), and consistently higher (39%). Compared with lower stable CRP, both consistently higher (adjusted odds ratio [aOR] 1.67, 95% CI 1.23-2.26) and moderately/increasing (aOR 2.04, 95% CI 1.40-2.96) CRP had higher odds of poor processing speed; consistently higher CRP additionally had higher odds of poor executive function (aOR 1.36, 95% CI 1.00-1.88). For memory (moderately/increasing aOR 1.36, 95% CI 1.00-1.88; consistently higher aOR 1.18, 95% CI 0.90-1.54), letter fluency (moderately/increasing aOR 1.00, 95% CI 0.69-1.43; consistently higher aOR 1.05, 95% CI 0.80-1.39), category fluency (moderately/increasing aOR 1.16, 95% CI 0.82-1.63; consistently higher aOR 1.11, 95% CI 0.85-1.45), or global cognition (moderately/increasing aOR 1.16, 95% CI 0.82-1.63; consistently higher aOR 1.11, 95% CI 0.85-1.45), no association was observed. Consistently higher or moderate/increasing inflammation starting in early adulthood may lead to worse midlife executive function and processing speed. Study limitations include selection bias due to loss to follow-up and reliance on CRP as the only inflammatory marker. Inflammation is important for cognitive aging and may begin much earlier than previously known.