| Mucins—large, highly glycosylated proteins—are important for the luminal protection of the gastrointestinal tract. Enterocytes have their apical surface covered by transmembrane mucins and goblet cells produce the secreted gel-forming mucins that form mucus. The small intestine has a single unattached mucus layer, which in cystic fibrosis becomes attached, accounting for the intestinal manifestations of this disease. The stomach and colon have two layers of mucus; the inner layer is attached and the outer layer is less dense and unattached. In the colon, the outer mucus layer is the habitat for commensal bacteria. The inner mucus layer is impervious to bacteria and is renewed every hour by surface goblet cells. The crypt goblet cells have the ability to restitute the mucus layer by secretion, for example after an ischaemic challenge. Proteases of certain parasites and some bacteria can cleave mucins and dissolve the mucus as part of their pathogenicity. The inner mucus layer can, however, also become penetrable to bacteria by several other mechanisms, including aberrations in the immune system. When bacteria reach the epithelial surface, the immune system is activated and inflammation is triggered. This mechanism might occur in some types of ulcerative colitis.