Background and Purpose: The defective colonic mucus barrier is a feature of ulcerative colitis (UC) that enables increased bacterial contact with the epithelium, which triggers mucosal damage, and gastrin has been reported to be able to promote healing through the cholecystokinin 2 receptor (CCK2R) signaling to increase epithelial regeneration and protect against colonic injury. However, the role of gastrin in UC remains unclear. Experimental Approach: Colonic samples from human sections and mouse models using β-arrestin1 wild-type (β-arr1-WT) and β-arrestin1 knockout (β-arr1-KO) littermates, intestinal epithelial cells specific NF-κBp65 deletion (NF-κBp65IEC-KO) and wild-type (NF-κBp65IEC-WT) mice were analyzed. The mucosal injury, goblet cells status, MUC2 expression and bacteria penetration/colonisation were examined, and the effect of gastrin in colitis was also investigated. Key Results: We demonstrate that mucus barrier loss and bacterial colonisation of the crypts were observed in colitis, and exogenous gastrin could restore the mucus barrier, reduce bacterial colonisation of the colonic crypts and alleviate colitis via CCK2R. Furthermore, targeting CCK2R by YF476, β-arrestin1 (β-arr1) deletion or intestinal epithelial NF-κBp65 deficiency breached gastrin-mediated mucus barrier restoration and mucosal protection in colitis. Conclusion and Implications: These data demonstrate that gastrin alleviates mucus barrier loss and bacterial colonisation of the colonic crypts via CCK2R/β-arr1/NF-κBp65 signaling in colitis, and this network may be a potential therapeutic target for UC.