Background. Detrimental effects of diarrhea on child growth and survival are well documented, but details of the underlying mechanisms remain poorly understood. Recent evidence demonstrates that perturbations to normal development of the gut microbiota in early life may contribute to growth faltering and susceptibility to related childhood diseases. We assessed associations between diarrhea, gut microbiota configuration, and childhood growth in the Peruvian Amazon. Methods. Growth, diarrhea incidence, illness, pathogen infection, and antibiotic exposure were assessed monthly in a birth cohort of 271 children aged 0-24 months. Gut bacterial diversity and abundances of specific bacterial taxa were quantified by sequencing 16S rRNA genes in fecal samples collected at 6, 12, 18, and 24 months. Linear and generalized linear models were used to determine whether diarrhea was associated with altered microbiota and, in turn, if features of the microbiota were associated with the subsequent risk of diarrhea. Results. Diarrheal frequency, duration, and severity were negatively associated with bacterial diversity and richness (P < .05). Children born stunted (length-for-age z-score [LAZ] ≤ -2) who were also severely stunted (LAZ ≤ -3) at the time of sampling exhibited the greatest degree of diarrhea-associated reductions in bacterial diversity and the slowest recovery of bacterial diversity after episodes of diarrhea. Increased bacterial diversity was predictive of reduced subsequent diarrhea from age 6 to 18 months. Conclusions. Persistent, severe growth faltering may reduce the gut microbiota's resistance and resilience to diarrhea, leading to greater losses of diversity and longer recovery times. This phenotype, in turn, denotes an increased risk of future diarrheal disease and growth faltering.