OBJECTIVE: To determine whether Helicobacter pylori, a chronic bacterial infection often acquired in childhood, is associated with increased risk of coronary heart disease and stroke later in life. DESIGN: Nested case-control study. SETTING: Prospective study of cardiovascular disease in men aged 40-59 years at entry (1978-1980) in 24 British towns. SUBJECTS: 135 cases of myocardial infarction and 137 cases of stroke occurring before December 1991; 136 controls were identified, frequency matched to cases by town and age group. METHODS: Serum samples stored at entry were analysed by an enzyme linked immunosorbent assay for the presence of H pylori specific IgG antibodies. RESULTS: 95 of the myocardial infarction cases (70%) and 93 (68%) of the stroke cases were seropositive for H pylori compared with 78 (57%) of the controls (odds ratio for myocardial infarction 1.77, 95% confidence interval (CI) 1.06 to 2.95, P = 0.03; odds ratio for stroke 1.57, 95% CI 0.95 to 2.60, P = 0.07). Helicobacter pylori infection was associated with manual social class, residence in Northern England or Scotland, cigarette smoking, higher systolic pressure and blood glucose, and a lower height-standardised forced expiratory volume in one second. Adjustment for these factors attenuated the relation between H pylori and myocardial infarction (odds ratio = 1.31, 95% CI 0.70 to 2.43, P = 0.40) and effectively abolished the relation with stroke (odds ratio = 0.96, 0.46 to 2.02, P = 0.92). The relation between helicobacter infection and fatal myocardial infarction was slightly stronger (odds ratio 2.41, 95% CI 1.13 to 5.12) but was also markedly attenuated after adjustment (1.56, 95% CI 0.68 to 3.61). CONCLUSION: In this prospective study the association between Helicobacter pylori infection and increased risk of myocardial infarction and stroke was substantially confounded by the relation between this infection, adult social class, and major cardiovascular risk factors.