The synergistic effects of pyrolysis byproduct, biochar (BC) on heavy metal consolidation, and H2S removal during and after from microwave pyrolysis of municipal sludge were studied in this paper. The results showed that above 80% of heavy metals (Zn and Pb) were enriched in the biochar and the leaching toxicity of both heavy metals was lower than the national emission standards. The chemical specification analysis found the sum of acid-soluble/exchangeable fraction (F1) and reducible fraction (F2) for Pb and Zn metals decreased by 26 and 40%; however, the residual fraction (F4) increased 33 and 46%, which contributed to the good stabilization of heavy metals in biochar. Besides, biochar achieved high H2S removal efficiency of 78.4% compared with the commercial activated carbon (AC). Furthermore, the biochar prepared by microwave pyrolysis had excellent adsorption performance, which was attributed to its larger specific surface area of 476.87m2/g under nitrogen atmosphere at 650oC compared with traditional pyrolysis. The mechanism analysis showed that microwave pyrolysis resulted in the high alkaline condition and formation of a large number of microparticles containing large metal elements on the biochar surface, which mainly contributed to the stabilization of heavy metals. The metal oxides adsorbed on the surface of biochar can catalyze the oxidation of H2S absorption, which will change the pH atmosphere of biochar reducing the leaching behavior of heavy metals. This study provided the good application potential of solid waste (biochar) for simultaneous heavy metal stabilization and H2S capture.