This study aimed to investigate the combined ecotoxicological effects of Cd, Pb, Zn, Hg and regulation mechanisms in Solanum nigrum L. In this work, the co-exposure of these four heavy metals hindered the transformation of Cd, Zn, and Hg (except Pb) from available to non-available chemical forms. Individual Cd, Pb, Zn and Hg induced the oxidative damages to S. nigrum L., while their combination further enhanced this ecological toxicity. By internal regulation, the ecological toxicity of metals to S. nigrum L. could be alleviated to a certain extent. Specifically, S. nigrum L. was a hyperaccumulator of Cd with BCF >1. Moreover, since BCFroot of Pb, Zn and Hg were all greater than BCFshoot, S. nigrum L. could accumulate Pb, Hg and Zn mainly in plant roots, which was beneficial for the detoxification of plants. Meanwhile, the immobilization by cell wall (the proportions of Cd, Pb, Zn and Hg in the cell wall were 54.46–84.92%, 38.33–49.25%, 48.38–56.19% and 45.97–63.47% in low metal concentration treatments) and the sequestration in vacuole (the proportions of Cd, Pb, Zn, and Hg in the soluble fractions are 50.99–59.00%, 41.05–45.46%, 37.54–61.04% and 33.47–61.35% in high metal concentration treatments) also act as important detoxification pathways. The external regulation was mainly the changes of soil microbial communities influenced by plants. Specifically, the richness and diversity of bacteria in rhizosphere soil were increased, and roots of S. nigrum L. recruited some potentially beneficial microbials. This study provided a theoretical basis and guidance for S. nigrum L. as a phytoremediation plant under combined heavy metal pollution.