Glycosylation is an essential post-translational modification, which determines the function of proteins and important processes such as inflammation. β-1,4-galactosyltransferase I (βGalT1) is a key enzyme involved in the addition of galactose moieties to glycoproteins. Intestinal mucins are glycoproteins that protect the gut barrier against invading pathogens and determine the composition of the intestinal microbiota. Proper glycosylation of mucus is important in this regard. By using ubiquitously expressing βGalT1 transgenic mice, we found that this enzyme led to strong galactosylation of mucus proteins, isolated from the gut of mice. This galactosylation was associated with a drastic change in composition of gut microbiota, as TG mice had a significantly higher Firmicutes to Bacteroidetes ratio. TG mice were strongly protected against TNF-induced systemic inflammation and lethality. Moreover, βGalT1 transgenic mice were protected in a model of DSS-induced colitis, at the level of clinical score, loss of body weight, colon length and gut permeability. These studies put βGalT1 forward as an essential protective player in exacerbated intestinal inflammation. Optimal galactosylation of N-glycans of mucus proteins, determining the bacterial composition of the gut, is a likely mechanism of this function.