Mammalian gut microbial communities govern host development, metabolism, immune function, and physiology, through interactions that range from commensal and mutualistic to pathogenic. However, we know little about the relative contributions of vertical, horizontal, and environmental transmission to gut microbiome composition, despite its importance to host health. To address this knowledge gap, I integrated field-collected data, molecular analyses, and computational and statistical approaches to examine how social networks and proximity to other host species influence bacteria transmission and gut microbiome composition in the wild mammals inhabiting Kirindy Mitea Biosphere Reserve in western Madagascar. In Chapter 1, I estimated the impacts of multilevel social structure, individual demographic traits, diet, scent-marking, and habitat overlap on gut bacteria acquisition in a wild lemur population (Verreaux’s sifaka, Propithecus verreauxi). The gut microbiomes of wild sifaka clearly reflected their social group membership, and both grooming and scent-marking behaviors promote microbial exchange and within-host diversity. In Chapter 2, I extended this work by examining how sifaka social dynamics influenced gut microbial turnover within individual animals and social groups over the course of several years. Sifaka social groups harbored distinct gut microbial communities throughout the study period, and compositional changes in the microbiota of individual animals were influenced by the gain or loss of unique social partners and dispersal between groups. In Chapter 3, I assayed the gut microbial communities of six sympatric (i.e., co-occurring) mammal populations— three lemur and three non-primate species – and assessed evolutionary, dietary, and behavioral predictors of microbiome functionality and composition. The ecological relationships among mammalian gut microbiomes mirrored their hosts’ phylogeny, with the three lemur species clustering separately from the other mammal species. The predicted functionality of lemur microbiomes differentiated according to diet, and distantly-related terrestrial mammals exhibited overlapping microbial communities, suggesting that ground dwelling facilitates the indirect horizontal transmission of gut bacteria among sympatric wild mammals. Together, these findings demonstrate that patterns of gut microbiome composition in wild mammals are scale-dependent: host phylogeny, diet, and substrate use shape microbial variation among sympatric mammal taxa, while social groupings and social contacts constrain the horizontal transmission of gut bacteria within a single host populationEcology, Evolution and Behavio