A mucus layer covers and protects the intestinal epithelial cells from direct contact with microbes. This mucus layer not only prevents inflammation but also plays an essential role in microbiota colonization, indicating the complex interplay between mucus composition-microbiota and intestinal health. However, it is unknown whether the mucus layer is influenced by age or sex and whether this contributes to reported differences in intestinal diseases in males and females or with ageing. Therefore, in this study we investigated the effect of age on mucus thickness, intestinal microbiota composition and immune composition in relation to sex. The ageing induced shrinkage of the colonic mucus layer was associated with bacterial penetration and direct contact of bacteria with the epithelium in both sexes. Additionally, several genes involved in the biosynthesis of mucus were downregulated in old mice, especially in males, and this was accompanied by a decrease in abundances of various Lactobacillus species and unclassified Clostridiales type IV and XIV and increase in abundance of the potential pathobiont Bacteroides vulgatus. The changes in mucus and microbiota in old mice were associated with enhanced activation of the immune system as illustrated by a higher percentage of effector T cells in old mice. Our data contribute to a better understanding of the interplay between mucus-microbiota-and immune responses and ultimately may lead to more tailored design of strategies to modulate mucus production in targeted groups.