Immunological dysregulation is the cause of many non-infectious human diseases such as autoimmunity, allergy and cancer. The gastrointestinal tract is the primary site of interaction between the host immune system and microorganisms, both symbiotic and pathogenic. In this Review we discuss findings indicating that developmental aspects of the adaptive immune system are influenced by bacterial colonization of the gut. We also highlight the molecular pathways that mediate host-symbiont interactions that regulate proper immune function. Finally, we present recent evidence to support that disturbances in the bacterial microbiota result in dysregulation of adaptive immune cells, and this may underlie disorders such as inflammatory bowel disease. This raises the possibility that the mammalian immune system, which seems to be designed to control microorganisms, is in fact controlled by microorganisms.