The gut microbiome is an integral part of a species' ecology, but we know little about how host characteristics impact its development in wild populations. Here, we explored the role of such intrinsic factors in shaping the gut microbiome of northern elephant seals during a critical developmental window of six weeks after weaning, when the pups stay ashore without feeding. We found substantial sex-differences in the early-life gut microbiome, even though males and females could not yet be distinguished morphologically. Sex and age both explained around 15% of the variation in gut microbial beta diversity, while microbial communities sampled from the same individual showed high levels of similarity across time, explaining another 40% of the variation. Only a small proportion of the variation in beta diversity was explained by health status, assessed by full blood counts, but clinically healthy individuals had a greater microbial alpha diversity than their clinically abnormal peers. Across the post-weaning period, the northern elephant seal gut microbiome was highly dynamic. We found evidence for several colonisation and extinction events as well as a decline in Bacteroides and an increase in Prevotella, a pattern that has previously been associated with the transition from nursing to solid food. Lastly, we show that genetic relatedness was correlated with gut microbiome similarity in males but not females, again reflecting early sex-differences. Our study represents a naturally diet-controlled and longitudinal investigation of how intrinsic factors shape the early gut microbiome in a species with extreme sex differences in morphology and life history. This article is protected by copyright. All rights reserved.