Previous studies revealed that both Helicobacter pylori infection and some cytokine gene polymorphisms are risk factors for gastric diseases. The association between H. pylori and gene polymorphisms is worth exploring. Here we conducted a case–control study and systematically evaluate on association between H. pylori infection and IL4, TNFA, and IL10 polymorphisms in a Chinese Han population in northwestern China, where gastric cancer is the major burden on the health and the leading cause of death in local community. The Sequenom MassArray platform was used to screen the genotypes and 14C-urea breath test was employed to determine H. pylori infection status of 705 participants of the local rural residents. Significant association between H. pylori infection and the IL4 rs34142320 polymorphism was observed in the dominant model (OR = 0.57, 95% CI = 0.40–0.80, P = 0.030). No significant association was found between IL4 rs2243250, TNFA rs1800630, TNFA rs1800629, TNFA rs1799964, IL10 rs1800871, IL10 rs1800896 and H. pylori infection. Haplotype analysis showed that T-DEL and G-C haplotypes of the observed IL4 SNPs were significantly associated with H. pylori infection. Our analysis demonstrated that the IL4 rs34142320 polymorphism has a protective effect on H. pylori infection in Chinese Han population.