Dietary protein might modulate mucin flow and intestinal mucin gene expression. Since unheated phaseolin from Phaseolus vulgaris bean is resistant to digestion and increases gut endogenous protein losses, we hypothesised that unheated phaseolin influences mucin flow and gene expression, and that phaseolin heat treatment reverses these effects. The hypothesis was tested using a control diet containing casein as the sole protein source and three other diets with casein being replaced by 33 and 67 % of unheated and 67 % of heated phaseolin. The rats were fed for 6 d and euthanised. Digesta and faeces were collected for determining digestibility and mucin flow. Gut tissues were collected for mucin (Muc1, Muc2, Muc3 and Muc4) and Trefoil factor 3 (Tff3) gene expressions. Colonic mucin flow decreased linearly with increasing the dietary level of unheated phaseolin (P < 0·05). Unheated phaseolin increased N flow in ileum, colon and faeces (P < 0·05), and reduced apparent N digestibility linearly (P < 0·01). Heat treatment reversed all these changes (P < 0·05 to < 0·001), except mucin flow. The expressions of Muc mRNA in gut tissues were influenced by dietary phaseolin level (ileum and colon: Muc3 and Muc4) and thermal treatment (ileum: Muc2; colon: Muc2, Muc3, Muc4 and Tff3) (P < 0·05 to 0·001). In conclusion, phaseolin modulates mucin flow and Muc gene expression along the intestines differentially.