Previous studies have reported lower fecal bacterial diversity in urban populations compared with those living in rural settings. However, most of these studies compare geographically distant populations from different countries and even continents. The extent of differences in the gut microbiome in adjacent rural versus urban populations, and the role of such differences, if any, during enteric infections remain poorly understood. To provide new insights into these issues, we sampled the gut microbiome of young children with and without acute diarrheal disease (ADD) living in rural and urban areas in northern Ecuador. Shotgun metagenomic analyses of non-ADD samples revealed small but significant differences in the abundance of microbial taxa, including a greater abundance of Prevotella and a lower abundance of Bacteroides and Alistipes in rural populations. Greater and more significant shifts in taxon abundance, metabolic pathway abundance, and diversity were observed between ADD and non-ADD status when comparing urban to rural sites (Welch's t-test, P < 0.05). Collectively our data show substantial functional, diversity, and taxonomic shifts in the gut microbiome of urban populations with ADD, supporting the idea that the microbiome of rural populations may be more resilient to ADD episodes.