ABSTRACT Cognitive dysfunction is a common symptom experienced by elderly individuals after surgery, resulting in memory problems, difficulties with logical thinking, hallucinations, delusions, and an increased risk of dementia. Despite its prevalence, the underlying cause of postoperative cognitive dysfunction remains unclear. Recent research has uncovered a link between neurodegenerative diseases and the gut microbiota, indicating the need for further investigation into the role of the intestinal flora in postoperative cognitive dysfunction. To address this research gap, we conducted behavioral tests, gene and protein analyses, metagenomics, and non-targeted metabolomics to compare the gut microbiota and metabolomics of mice exposed to anesthesia/surgery that exhibited cognitive impairment with those of age-matched control mice. Our goal was to identify possible correlations between these factors. We found that mice experiencing postoperative cognitive dysfunction had a distinct microbial composition, neuroinflammation, and synaptic damage compared to the control group. Specifically, we observed significant increases in the relative abundances of Bacteroidetes unclassified, Bacteroides acidifaciens, Rikenellaceae bacterium, Muribaculaceae bacterium Isolate-104 HZI, Muribaculaceae bacterium Isolate-110 HZI, and Mucispirillum schaedleri in aged mice exposed to anesthesia and surgery, while the relative abundances of Lachnospiraceae bacterium A2, Lachnospiraceae bacterium A4, Lachnospiraceae bacterium, Blautia, Lachnoclostridium bacterium MD355, Eubacterium rectale, Ruminococcus sp. 1xD21-23, and Butyrivibrio were significantly decreased. Additionally, metabolites, such as thiamine, spermidine, and long-chain unsaturated fatty acids, were down-regulated compared to the control group. These findings suggest that the intestinal metabolic abnormalities observed in elderly mice exposed to anesthesia/surgery may be regulated by the intestinal microbiota, specifically the Lachnospiraceae, Lachnoclostridium, Butyrivibrio, and Eubacterium. Therefore, our study highlights the potential of manipulating the gut microbiota to modulate the host metabolism in order to prevent and manage postoperative cognitive dysfunction. IMPORTANCE As the population ages and medical technology advances, anesthesia procedures for elderly patients are becoming more common, leading to an increased prevalence of postoperative cognitive dysfunction. However, the etiology and correlation between the gut microbiota and cognitive dysfunction are poorly understood, and research in this area is limited. In this study, mice with postoperative cognitive dysfunction were found to have reduced levels of fatty acid production and anti-inflammatory flora in the gut, and Bacteroides was associated with increased depression, leading to cognitive dysfunction and depression. Furthermore, more specific microbial species were identified in the disease model, suggesting that modulation of host metabolism through gut microbes may be a potential avenue for preventing postoperative cognitive dysfunction.