The pathogenesis of human immunodeficiency virus (HIV)-associated dementia is unclear, and the underlying pathological substrate has been a matter of debate. In a prospectively clinically characterized population of acquired immunodeficiency syndrome (AIDS) patients we investigated the relationship between the clinical syndrome of HIV-associated dementia and the presence and relative quantity of immunocytochemical markers for HIV-1 (gp41 antibody), and for macrophages and microglia (HAM-56 antibody). Sections from the basal ganglia and frontal lobes from the brains of 51 patients were studied, and the data were stratified for severity of dementia (16 nondemented, 12 mildly demented, 23 severely demented), rate of dementia progression, duration of AIDS, use of antiretrovirals, and several other demographic features. We found a highly significant correlation between the degree of macrophage staining and the severity of dementia but only a borderline correlation between the presence and amount of gp41-positive cells and dementia. Several nondemented patients showed abundant gp41 immunoreactivity, and some severely demented showed little to no gp41 immunoreactivity. Other correlations with the immunostaining data, including antiretroviral use, were not significant. We conclude that the presence of macrophages and microglia is a better correlate with HIV-associated dementia than is the presence and amount of HIV-infected cells in the brain. These data support the concept that the pathogenesis of HIV-associated dementia is likely due to indirect effects of HIV infection of the brain, possibly through the actions of macrophages and microglia.