Growing evidence has demonstrated that signal transducer and activator of transcription 3 (STAT3), which is constitutively activated in patients with hepatocellular carcinoma (HCC), plays an important role in HCC development, progression, and prognosis. Interleukin-6 (IL-6) is a multifunctional inflammatory cytokine, which may induce STAT3 activation in a variety of human cancers. In this study, we demonstrated that blocking STAT3 phosphorylation with STAT3 small molecule inhibitors SD-1029 and Stattic caused apoptosis in HCC cells. Then we characterized the inhibitory effects of a novel small molecule XZH-5 on STAT3 phosphorylation in HCC cell lines. XZH-5 reduced constitutive STAT3 phosphorylation at Tyr705 and the expression of STAT3 downstream genes. The inhibition of STAT3 in HCC cells resulted in the induction of apoptosis and reduction of colony forming ability. In addition, XZH-5 also inhibited IL-6-induced STAT3 phosphorylation, nuclear translocation and STAT3 DNA binding activity. In contrast, it had no effect on IFN-γ-induced STAT1 phosphorylation, indicating the more selective effects on STAT3. These results suggested that XZH-5 may serve as a lead compound for further development of STAT3 specific small molecule inhibitors for HCC therapy.