Ca plays an essential role in bone development; however, little is known about its effect on intestinal gene expression in juvenile animals. In the present study, thirty-two weaned pigs (9·5 (sem 0·11) kg) were assigned to four diets that differed in Ca concentration (adequate v. high) and cereal composition (wheat–barley v. maize) to assess the jejunal and colonic gene expression of nutrient transporters, tight junction proteins, cytokines and pathogen-associated molecular patterns, nutrient digestibility, Ca balance and serum acute-phase response. To estimate the impact of mucosal bacteria on colonic gene expression, Spearman's correlations between colonic gene expression and bacterial abundance were computed. Faecal Ca excretion indicated that more Ca was available along the intestinal tract of the pigs fed high Ca diets as compared to the pigs fed adequate Ca diets (P< 0·05). High Ca diets decreased jejunal zonula occludens 1 (ZO1) and occludin (OCLN) expression, up-regulated jejunal expression of toll-like receptor 2 (TLR2) and down-regulated colonic GLUT2 expression as compared to the adequate Ca diets (P< 0·05). Dietary cereal composition up-regulated jejunal TLR2 expression and interacted (P= 0·021) with dietary Ca on colonic IL1B expression; high Ca concentration up-regulated IL1B expression with wheat–barley diets and down-regulated it with maize diets. Spearman's correlations (r>0·35; P< 0·05) indicated an association between operational taxonomic units assigned to the phyla Bacteroidetes, Firmicutes and Proteobacteria and bacterial metabolites and mucosal gene expression in the colon. The present results indicate that high Ca diets have the potential to modify the jejunal and colonic mucosal gene expression response which, in turn, interacts with the composition of the basal diet and mucosa-associated bacteria in weaned pigs.