Provided are polypeptides having the effects of inhibiting hepatitis B virus x protein (HBx) and polynucleotides encoding the peptides. Also provided are peptidomimetics, functional fragments and functional variants thereof, as well as the encoding genes thereof. The polypeptides and peptidomimetics can be used for the treatment and prevention of liver diseases resulted from hepatitis B virus infection, including hepatitis, cirrhosis and liver cancer.