The prevalence of Helicobacter pylori infection is decreasing in developed countries. In this study we included 22 612 patients in whom a first culture of gastric biopsy (routinely performed in our medical centres) yielded an interpretable result over a 20-year period (1988–2007) in Brussels. The effects of patients' age, gender and ethnic background were analysed. The overall proportion of H. pylori-infected patients was 37·7%, with a progressive decline over time (P<10−5). A gender effect was observed in adults. The lowest infection rate was observed in Western European patients (n=11 238) with respectively 36·2% and 15·2% infected subjects in 1988 and 2007, compared to 71·7% and 40% in North African patients (n=3200) (P<10−5). However, no trend of decline was observed over time in North African children aged ⩽9 years. These data show the effects of time, age and ethnicity on the prevalence of H. pylori infection, and its complex heterogeneity in the same cosmopolitan urban area.