Small bowel transplants provide an exceptional opportunity for long-term study of the microbial ecology of the human small bowel. The ileostomy created at time of transplant for ongoing monitoring of the allograft provides access to samples of ileal effluent and mucosal biopsies. In this study, we used qPCR to assay the bacterial population of the small bowel lumen of 17 small bowel transplant patients over time. Surprisingly, the posttransplant microbial community was found to be dominated by Lactobacilli and Enterobacteria, both typically facultative anaerobes. This represents an inversion of the normal community that is dominated instead by the strictly anaerobic Bacteroides and Clostridia. We found this inverted community also in patients with ileostomies who did not receive a transplant, suggesting that the ileostomy itself is the primary ecological determinant shaping the microbiota. After surgical closure of the ileostomy, the community reverted to the normal structure. Therefore, we hypothesized that the ileostomy allows oxygen into the otherwise anaerobic distal ileum, thus driving the transition from one microbial community structure to another. Supporting this hypothesis, metabolomic profiling of both communities demonstrated an enrichment for metabolites associated with aerobic respiration in samples from patients with open ileostomies. Viewed from an ecological perspective, the two communities constitute alternative stable states of the human ileum. That the small bowel appears to function normally despite these dramatic shifts suggests that its ecological resilience is greater than previously realized.