Helicobacter pylori-associated gastritis is a major threat to public health and Polygonum capitatum (PC) may have beneficial effects on the disease. However, the molecular mechanism remains unknown. Quercetin was isolated from PC and found to be a main bioactive compound. The effects of quercetin on human gastric cancer cells GES-1 were determined by xCELLigence. H. pylori-infected mouse models were established. All mice were divided into three groups: control (CG, healthy mice), model (MG, H. pylori infection) and quercetin (QG, mouse model treated by quercetin) groups. IL-8 (interleukin-8) levels were detected via enzyme-linked immunosorbent assay (ELISA). Cell cycle and apoptosis were measured by flow cytometry (FCM). Quantitative reverse transcription PCR (qRT-PCR) and Western Blot were used to detect the levels of p38MAPK (38-kD tyrosine phosphorylated protein kinase), apoptosis regulator BCL-2-associated protein X (BAX) and B cell lymphoma gene 2 (BCL-2). The levels of IL-8 were increased by 8.1-fold in a MG group and 4.3-fold in a QG group when compared with a CG group. In a MG group, G0–G1(phases of the cell cycle)% ratio was higher than a CG group while S phase fraction was lower in a model group than in a control group ( p < 0.01). After quercetin treatment, G0–G1% ratio was lower in a QG group than a MG group while S phase fraction was higher than a MG group ( p < 0.01). Quercetin treatment reduced the levels of p38MAPK and BAX, and increased the levels of BCL-2 when compared with a MG group ( p < 0.05). Quercetin regulates the balance of gastric cell proliferation and apoptosis to protect against gastritis. Quercetin protects against gastric inflammation and apoptosis associated with H. pylori infection by affecting the levels of p38MAPK, BCL-2 and BAX.