Phosphorus-solubilizing bacteria are widely studied for their ability to immobilize heavy metals and promote plant growth. However, previous studies have been focused on the effects of phosphate-solubilizing bacteria on phosphorus release and heavy metal immobilization, and there is a lack of research on the effects of phosphatesolubilizing bacteria on rhizosphere soil bacterial communities and metabolites. In this study, the effects of Klebsiella sp. M2 on wheat rhizosphere microbiome and metabolism were investigated as well as the impact of these changes on wheat absorption of Cd. The results showed that under Cd stress, strain M2 reduced (77.54 %) the content of Cd in culture medium and secreted metabolites involved in plant growth promotion, Cd resistance, and phosphorus solubilization. A pot experiment showed that compared with the control, strain M2 increased (14.3 %-35.9 %) the dry weight and reduced (33.3 %-66.7 %) the content of Cd in wheat grains, straw, and roots. Strain M2 increased the exchangeable Ca, Ca2-P and Fe-P contents, soil pH, and alkaline phosphatase activity and decreased the acid-extractable Cd content in rhizosphere soil. The increase in Ca concentration had a significant promoting effect on the pH in rhizosphere soil. Moreover, the relative abundances of key bacteria such as Ramlibacter, Microvirga, Pseudarthrobacter, Massilia, Streptomyces, and Paenibacillus increased. Additionally, strain M2 increased the contents of some substances in rhizosphere soil that play an important role in immobilizing Cd and solubilizing phosphorus as well as improving wheat tolerance to Cd. The results showed that inoculation with an exogenous phosphate-solubilizing bacterial strain can result in the activation of key functional bacteria and the regulation of metabolite production in wheat rhizosphere soil to immobilize heavy metals, which has broad potential in the remediation of wheat fields with high heavy metal levels.