The mediation pathway consisted of a negative association between H. pylori seropositivity and TNFSF18 levels (β: -0.475; P = 0.075) and a strong negative association between TNFSF18 and GC risk (β: -0.115; P = 1.09 × 10-64). Here, TNFSF18 is linked to gastric cancer.