BACKGROUND: The majority (∼65%) of food products purchased by United States households are considered ultraprocessed foods (UPFs). Consumption of UPF is associated with a variety of adverse health outcomes including dementia. Most research on UPF consumption and cognition measure UPF as a single entity despite extensive variability in the types of foods that are considered UPF. OBJECTIVES: The objective of this study was to investigate the extent to which consumption of individual categories of UPF are related to risk of developing cognitive impairment over 7 y. METHODS: Data from the Health and Retirement Study (HRS), a panel study, were used to examine UPF consumption and risk of developing cognitive impairment in 4750 middle-aged and older United States adults. Diet was assessed using the Harvard Food Frequency Questionnaire at baseline and cognitive status was assessed biennially from 2014 to 2020 using measures of recall and executive function. Foods were categorized using the NOVA system. The UPF foods were divided into categories based on previously reported criteria. The relationship between total UPF consumption and 9 UPF categories and cognitive status were assessed using adjusted Cox proportional hazard analyses. RESULTS: In total, 1363 participants developed cognitive impairment. Consumption of an additional average daily serving of ultraprocessed animal products and beverages were associated with 17% (95% Confidence interval [CI]: 1.032, 1.326) and 6.3% (95% CI: 1.010, 1.118) heightened risk of developing cognitive impairment throughout the study period, respectively. Total UPF consumption and consumption of other UPF categories (other, sweets, spreads, savory snacks, ready-to-eat meals, grains, and dairy-based) were not associated with risk of developing cognitive impairment. CONCLUSIONS: These results reinforce the value of separating UPF into categories. The link between UPF animal products and beverages with cognitive functions may be, in part, explained by their ingredients, such as additives, or by the poor nutritional composition of products rich in simple sugars and low in dietary fibers.