BHLHE40, a member of the basic helix-loop-helix transcription factor family, has been reported to play an important role in inflammatory diseases. However, the regulation and function of BHLHE40 in Helicobacter pylori (H pylori)-associated gastritis is unknown. We observed that gastric BHLHE40 was significantly elevated in patients and mice with H pylori infection. Then, we demonstrate that H pylori-infected GECs express BHLHE40 via cagA-ERK pathway. BHLHE40 translocates to cell nucleus, and then binds to cagA protein-activated p-STAT3 (Tyr705). The complex increases chemotactic factor CXCL12 expression (production). Release of CXCL12 from GECs fosters CD4+ T cell infiltration in the gastric mucosa. Our results identify the cagA-BHLHE40-CXCL12 axis that contributes to inflammatory response in gastric mucosa during H pylori infection.