The interaction between the gut microbiota and mercaptopurine (6-MP), a crucial drug used in pediatric acute lymphoblastic leukemia (ALL) treatment, has not been extensively studied. Here we reveal the significant perturbation of gut microbiota after 2-week 6-MP treatment in beagles and mice followed by the functional prediction that showed impairment of SCFAs production and altered amino acid synthesis. And the targeted metabolomics in plasma also showed changes in amino acids. Additionally, targeted metabolomics analysis of feces showed changes in amino acids and SCFAs. Furthermore, ablating the intestinal microbiota by broad-spectrum antibiotics exacerbated the imbalance of amino acids, particularly leading to a significant decrease in the concentration of S-adenosylmethionine (SAM). Importantly, the depletion of gut microbiota worsened the damage of small intestine caused by 6-MP, resulting in increased intestinal permeability. Considering the relationship between toxicity and 6-MP metabolites, we conducted a pharmacokinetic study in pseudo germ-free rats to confirm that gut microbiota depletion altered the methylation metabolites of 6-MP. Specifically, the concentration of MeTINs, a secondary methylation metabolite, showed a negative correlation with SAM, the pivotal methyl donor. Additionally, we observed a strong correlation between Alistipes and SAM levels in both feces and plasma. In conclusion, our study demonstrates that 6-MP disrupts the gut microbiota, and depleting the gut microbiota exacerbates 6-MP-induced intestinal toxicity. Moreover, SAM derived from microbiota plays a crucial role in influencing plasma SAM and the methylation of 6-MP. These findings underscore the importance of comprehending the role of the gut microbiota in 6-MP metabolism and toxicity.