Hepatocellular carcinoma (HCC) is well-known to be a highly prevalent malignant tumor, but the treatment of this pathological state has been still challenging. Solamargine (SM), a traditional Chinese herb-derived compound, has been widely reported to possess multiple antitumor properties. However, whether SM plays a vital role in HCC therapy and how it exerts an antitumor effect remains unclear. Thus, in this study, we demonstrated that SM inhibited the proliferation of HCC and effectively induced HCC cell apoptosis and autophagy in vitro and in vivo. Mechanistically, the oncogenic factor LIF was aberrantly elevated in HCC tissues and down-regulated by SM in HCC cells, as well as subsequently the overexpression of LIF could restore the anti-HCC effects of SM via miR-192-5p/CYR61/Akt signaling pathways. Additionally, SM could repolarize tumor associated macrophages by LIF/p-Stat3 to inhibit the growth and epithelial-mesenchymal transition of HCC, and simultaneously affected other immune cell populations in the immune (tumor) microenvironment by regulating macrophages, such as MDSCs, DCs and T cell populations. Together, these findings exploit the potential use of SM against HCC and shed light on exploring SM as a potent candidate drug for the future HCC therapeutics.