Bacterial DNA contains a high frequency of unmethylated cytosine-guanine (CpG) motifs that have strong immunostimulatory properties; they are recognized by mammalian Toll-like receptor 9 (TLR9). Because accumulating data suggest that chronic inflammatory processes are involved in the pathogenesis of neurodegenerative diseases, we hypothesized that inflammatory responses stimulated by CpG DNA might contribute to neurodegeneration and brain dysfunction. To assess the effects of continuous CpG DNA exposure in the brain, C57BL/6 (n = 21) and TLR9-deficient mice (n = 15) were given intracerebroventricular infusions of CpG DNA or saline for 28 days. Spatial memory assessed weekly by Morris water maze demonstrated impairment in CpG-treated wild-type mice but not in TLR9-deficient or control-treated mice. Motor function was not affected. Immunohistochemical analysis revealed marked microglial activation and acute axonal damage surrounding the ventricles, ependymal disruption, and reactive astrogliosis within the hippocampal formation in the CpG-treated wild-type but not TLR9-deficient mice or saline-infused controls. These results suggest that the unfavorable effects of CpG DNA are dependent on TLR9 signaling and that exposure to bacterial DNA may contribute to impaired neural function, neuroinflammation, and subsequent neurodegeneration.