The gastrointestinal tract is fundamental for the uptake of nutrients and fluids, but it also represents the greatest surface of the body in contact with the external environment and most human pathogens enter the body through the mucosal surface, especially in the intestine. The intestinal immune system protects the sterile core of the organism against invasion and systemic dissemination of both pathogens and limits for level penetration of commensal microorganisms. In addition, the human intestine is continually in contact with 10(14) commensal bacteria containing more than 500 different species. These commensal bacteria confer health benefits to their host by helping dietary digestion, development of gut immunity and preventing colonization by pathogens. To maintain integrity and normal function of intestine, a delicate equilibrium must be reached between the bacterial flora and intestinal immune system. This review discusses the recent advances in our understanding of how the mucosal intestinal barrier maintains a local homeostatic response to the resident intestinal bacteria, while protecting the host against enteric pathogens. In particular, the emerging function of Toll-like receptors (TLRs) and Nod-like receptors (NLRs) in controlling mucosal immunity will be presented.