Helicobacter pylori (H. pylori) infection is related with a high risk of Alzheimer's disease (AD), but the intrinsic link between H. pylori infection and AD development is still missing. In the present study, we explored the effect of H. pylori infection on cognitive function and β-amyloid production in rats. We found that intraperitoneal injection of H. pylori filtrate induced spatial learning and memory deficit in rats with a simultaneous retarded dendritic spine maturation in hippocampus. Injection of H. pylori filtrate significantly increased Aβ42 both in the hippocampus and cortex, together with an increased level of presenilin-2 (PS-2), one key component of γ-secretase involved in Aβ production. Incubation of H. pylori filtrate with N2a cells which over-express amyloid precursor protein (APP) also resulted in increased PS-2 expression and Aβ42 overproduction. Injection of Escherichia coli (E.coli) filtrate, another common intestinal bacterium, had no effect on cognitive function in rats and Aβ production in rats and cells. These data suggest a specific effect of H. pylori on cognition and Aβ production. We conclude that soluble surface fractions of H. pylori may promote Aβ42 formation by enhancing the activity of γ-secretase, thus induce cognitive impairment through interrupting the synaptic function.