Magnesium potassium phosphate cement (MKPC) is increasingly used in the solidification/stabilization (SS) of heavy metal (HM) pollutants. However, research on composite HM pollutants remains limited. In this study, four heavy metals (Pb/Zn/Cu/Cd) were individually and simultaneously introduced into MKPC systems with different magnesium/phosphorus (M/P) molar ratios. The introduction of HMs altered the extent of hydration and morphology of MgKPO4·6H2O. Among the MKPC pastes, those with M/P = 2 and 3 had the highest HM solidification efficiency and strength, respectively. The HM solidification efficiency of all specimens exceeded 99 %. In samples with M/P = 3, the codoping of four HMs slightly increased the M/P ratio, thereby increasing MgKPO4·6H2O content and enhancing strength. Pb could generate additional low-solubility precipitates, such as PbHPO4, Pb3 (PO4)2, Pb5 (OH) (PO4)3, and Pb (OH)2, which easily accumulated in pores and were encapsulated by MgKPO4·6H2O, leading to the highest solidification efficiency of Pb by MKPC. Pb and Cu could also form the composite phosphate products Pb2Cu (PO4)3 (OH)·4H2O, thus promoting the S/S effect of Cu. Therefore, the use of MKPC with M/P ratio of 2–3 for the S/S of complex pollutants containing Pb and Cu is a promising approach.