Centenarians display decreased susceptibility to ageing-associated illness, chronic inflammation, and infectious disease1–3. Here we show that centenarians have a distinct gut microbiome enriched in microbes capable of generating unique secondary bile acids (BAs), including iso-, 3-oxo-, allo-, 3-oxoallo-, and isoallo-lithocholic acid (LCA). Among these BAs, the biosynthetic pathway for isoalloLCA had not been described previously. By screening 68 bacterial isolates from a centenarian’s faecal microbiota, 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 isoalloLCA production. 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 specific bile acid metabolism may be involved in reducing the risk of pathobiont infection, thereby potentially contributing to the maintenance of intestinal homeostasis.