A community-based longitudinal study was conducted in Matlab, a rural area of Bangladesh, from May 1988 to April 1989 to examine the associations among malnutrition, cell-mediated immune deficiency, and the incidence of diarrhea in children under age 5 years. A cohort of 705 children was followed for a year; illnesses were ascertained every fourth day by home visits, anthropometric status was evaluated monthly, and cell-mediated immune status was assessed by a multiple antigen skin test at baseline and every 3 months. The diarrhea incidence rate was 4.6 episodes per year. Approximately three quarters of the children were below -2 z score weight for age and height for age, and about a third were below -2 z score weight for height. There was a modest association between undernutrition and the incidence of diarrhea. About 10-20% of the study children were anergic, and these children experienced a 50% increased incidence of diarrhea compared with their immunocompetent counterparts. This association persisted after controlling for the effects of age, nutritional status, socioeconomic status, and history of diarrhea in the previous 3 months. Malnutrition and cell-mediated immune deficiency were important independent risk factors for the occurrence of diarrhea and must both be considered in the design of interventions for the control of this condition.