The prevalence of the cagA gene and vacA alleles in 124 Spanish Helicobacter pylori clinical isolates from patients of different ages ranging from 3 to 78 years was studied (21 patients < or = 10 years, 30 patients 11-20 years, 17 patients 21-40 years, 31 patients 41-60 years and 25 patients 61-80 years). The cagA gene and vacA s1 or vacA s2 alleles were identified by PCR from the strain. 66.9% of the isolates were cagA+ and 33.1% cagA-. vacA s1 was detected in 48.4% of the isolates and vacA s2 in 51.6%. 44.4% of patients were cagA+/vacA s1, 22.5% were cagA+/vacA s2, 4% were cagA-/vacA s1 and 29% were cagA-/vacA s2. The percentage of cagA+ isolates and the vacA s1 alleles in the different groups were as follows: 23.8% and 28.6% in 0-10 years, 40% and 30% in 11-20 years, 88.2% and 70.6% in 21-40 years, 90.3% and 70.9% in 41-60 years and 92% and 44% in the 61-78 years group. 93% (54/58) of isolates found in ulcer patients and 90.9% (10/11) of isolates from gastritis patients older than 20 years were cagA+. In patients younger than 20 years ulcer disease was rare with 60% of isolates being cagA+ (3/5) compared with 31.6% cagA+ isolates (12/38) in patients suffering from gastritis in the younger group. The prevalence of the cagA gene and vacA s1 allele increased with age, being more frequent in older patients than in younger.