The intestinal mucus lines the luminal surface of the intestinal epithelium. This mucus is a dynamic semipermeable barrier and one of the first-line defense mechanisms against the outside environment, protecting the body against chemical, mechanical, or biological external insults. At the same time, the intestinal mucus accommodates the resident microbiota, providing nutrients and attachment sites, and therefore playing an essential role in the host–pathogen interactions and gut homeostasis. Underneath this mucus layer, the intestinal epithelium is organized into finger-like protrusions called villi and invaginations called crypts. This characteristic 3D architecture is known to influence the epithelial cell differentiation and function. However, when modelling in vitro the intestinal host–pathogen interactions, these two essential features, the intestinal mucus and the 3D topography are often not represented, thus limiting the relevance of the models. Here we present an in vitro model that mimics the small intestinal mucosa and its interactions with intestinal pathogens in a relevant manner, containing the secreted mucus layer and the epithelial barrier in a 3D villus-like hydrogel scaffold. This 3D architecture significantly enhanced the secretion of mucus. In infection with the pathogenic adherent invasive E. coli strain LF82, characteristic of Crohn’s disease, we observed that this secreted mucus promoted the adhesion of the pathogen and at the same time had a protective effect upon its invasion. This pathogenic strain was able to survive inside the epithelial cells and trigger an inflammatory response that was milder when a thick mucus layer was present. Thus, we demonstrated that our model faithfully mimics the key features of the intestinal mucosa necessary to study the interactions with intestinal pathogens.