Core 1–derived mucin-type O-glycans (O-glycans) are a major component of gastric mucus with an unclear role. To address this, we generated mice lacking gastric epithelial O-glycans (GEC C1galt1 −/− ). GEC C1galt1 −/− mice exhibited spontaneous gastritis that progressed to adenocarcinoma with ∼80% penetrance by 1 yr. GEC C1galt1 −/− gastric epithelium exhibited defective expression of a major mucus forming O-glycoprotein Muc5AC relative to WT controls, which was associated with impaired gastric acid homeostasis. Inflammation and tumorigenesis in GEC C1galt1 −/− stomach were concurrent with activation of caspases 1 and 11 (Casp1/11)–dependent inflammasome. GEC C1galt1 −/− mice genetically lacking Casp1/11 had reduced gastritis and gastric cancer progression. Notably, expression of Tn antigen, a truncated form of O-glycan, and CASP1 activation was associated with tumor progression in gastric cancer patients. These results reveal a critical role of O-glycosylation in gastric homeostasis and the protection of the gastric mucosa from Casp1-mediated gastric inflammation and cancer.