BACKGROUNDCognitive impairment is common in major depressive disorder (MDD) and potentially linked to inflammation-induced alterations in brain function. However, the relationship between inflammation, dynamic brain activity, and cognitive impairment in MDD remains unclear.METHODSFifty-seven first-episode, drug-naïve MDD patients and sixty healthy controls underwent fMRI scanning. Dynamic amplitude of low-frequency fluctuations (dALFF) and dynamic functional connectivity (dFC) were measured using the sliding window method. Plasma IL - 6 levels and cognitive function were assessed using enzyme-linked immunosorbent assay (ELISA) and the Repeated Battery for Assessment of Neuropsychological Status (RBANS), respectively.RESULTSMDD patients exhibited decreased dALFF in the bilateral inferior temporal gyrus (ITG), right inferior frontal gyrus, opercular part (IFGoperc), and bilateral middle occipital gyrus (MOG). Regions of dALFF associated with IL-6 included right ITG (r = -0.400/p = 0.003), left ITG (r = -0.381/p = 0.004), right IFGoperc (r = -0.342/p = 0.011), and right MOG (r = -0.327/p = 0.016). Furthermore, IL-6-related abnormal dALFF (including right ITG: r = 0.309/p = 0.023, left ITG: r = 0.276/p = 0.044) was associated with attention impairment. These associations were absent entirely in MDD patients without suicidal ideation. Additionally, IL-6 levels were correlated with dFC of specific brain regions.LIMITATIONSSmall sample size and cross-sectional study design.CONCLUSIONSInflammation-related dALFF was associated with attention impairment in MDD patients, with variations observed among MDD subgroups. These findings contribute to the understanding of the intricate relationship between inflammation, dynamic brain activity and cognitive impairments in MDD.