Enterohemorrhagic Escherichia coli (EHEC) O157:H7 are human pathogens responsible for bloody diarrhea and renal failures in developed countries. EHEC O157:H7 employ a type 3 secretion system (T3SS) and secreted effectors to attach directly to the human colonic epithelium. The T3SS is encoded by the locus of enterocyte effacement (LEE) whose expression is regulated in response to specific nutrients in the gut (1). In this study, we show that the mucin-derived sugars N-acetylglucosamine (NAG) and N-acetylneuraminic acid (NANA) inhibit EHEC O157:H7 adhesion to epithelial cells through down-regulation of the LEE expression. The effect of NAG and NANA is dependent on NagC, a transcriptional repressor of the NAG and galactose catabolism in E. coli. We also show that NagC is a direct transcriptional activator of the LEE expression and a critical regulator for the colonization of mice intestines by EHEC O157:H7. Finally, we demonstrate that the metabolic activity of B. thetaiotaomicron increases the concentration of NANA and NAG in the mammalian intestine while decreasing the expression of the LEE genes of EHEC O157:H7. This study highlights the role of NagC in coordinating metabolism and LEE expression in EHEC O157:H7 and the role of the microbiota in controlling the concentration of NAG and NANA which are inhibitors of the LEE expression.