Centenarians have a decreased susceptibility to ageing-associated illnesses, chronic inflammation and infectious diseases1-3. Here we show that centenarians have a distinct gut microbiome that is enriched in microorganisms that are capable of generating unique secondary bile acids, including various isoforms of lithocholic acid (LCA): iso-, 3-oxo-, allo-, 3-oxoallo- and isoallolithocholic acid. Among these bile acids, the biosynthetic pathway for isoalloLCA had not been described previously. By screening 68 bacterial isolates from the faecal microbiota of a centenarian, we identified Odoribacteraceae strains as effective producers of isoalloLCA both in vitro and in vivo. Furthermore, we found that the enzymes 5α-reductase (5AR) and 3β-hydroxysteroid dehydrogenase (3β-HSDH) were responsible for the production of isoalloLCA. IsoalloLCA exerted potent antimicrobial effects against Gram-positive (but not Gram-negative) multidrug-resistant pathogens, including Clostridioides difficile and Enterococcus faecium. These findings suggest that the metabolism of specific bile acids may be involved in reducing the risk of infection with pathobionts, thereby potentially contributing to the maintenance of intestinal homeostasis.