Hepatocellular carcinoma (HCC) is the most common primary liver malignant tumor, and the targeted therapy for HCC is very limited. Our previous study demonstrated that prodigiosin(PG), a secondary metabolite from Serratia marcescens found in the intestinal flora of cockroaches, inhibits the proliferation of HCC and increases the expression of CHOP, a marker protein for endoplasmic reticulum stress (ERS)-mediated apoptosis, in a dose-dependent manner. However, the mechanisms underlying the activity of PG in vivo and in vitro are unclear. This study explored the molecular mechanisms of PG-induced ERS against liver cancer in vitro and in vivo. The apoptosis of hepatocellular carcinoma cells induced by PG through endoplasmic reticulum stress was observed by flow cytometry, colony formation assay, cell viability assay, immunoblot analysis, and TUNEL assay. The localization of PG in cells was observed using laser confocal fluorescence microscopy. Flow cytometry was used to detect the intracellular Ca2+ concentration after PG treatment. We found that PG could promote apoptosis and inhibit the proliferation of HCC. It was localized in the endoplasmic reticulum of HepG2 cells, where it induces the release of Ca2+. PG also upregulated the expression of key unfolded response proteins, including PERK, IRE1α, Bip, and CHOP, and related apoptotic proteins, including caspase3, caspase9, and Bax, but down-regulated the expression of anti-apoptotic protein Bcl-2 in liver cancer. Alleviating ERS reversed the above phenomenon. PG had no obvious negative effects on the functioning of the liver, kidney, and other main organs in nude mice, but the growth of liver cancer cells was inhibited by inducing ERS in vivo. The findings of this study showed that PG promotes apoptosis of HCC by inducing ERS.