Alteration in gastrointestinal (GI) motility occurs in a variety of clinical settings which include acute enteritis, inflammatory bowel disease, intestinal pseudo-obstruction and irritable bowel syndrome (IBS). Most disorders affecting the GI tract arise as a result of noxious stimulation from the lumen via either microbes or chemicals. However, it is not clear how injurious processes initiated in the mucosa alter function in the deeper motor apparatus of the gut wall. Activation of immune cells may lead to changes in motor-sensory function in the gut resulting in the development of an efficient defence force which assists in the eviction of the noxious agent from the intestinal lumen. This review addresses the interface between immune and motor system in the context of host resistance based on the studies in murine model of enteric nematode parasite infection. These studies clearly demonstrate that the infection-induced T helper 2 type immune response is critical in producing the alterations of infection-induced intestinal muscle function in this infection and that this immune-mediated alteration in muscle function is associated with host defence mechanisms. In addition, by manipulating the host immune response, it is possible to modulate the accompanying muscle function, and this may have clinical relevance. These observations not only provide valuable information on the immunological control of gut motor function and its role in host defence in enteric infection, but also provide a basis for understanding pathophysiology of gastrointestinal motility disorders such as in IBS.