The long noncoding RNA growth-arrest specific 5 (GAS5) is a suppressor of many cancers. However, the role and mechanism of action of GAS5 in hepatitis B virus (HBV)-related hepatocellular carcinoma (HCC) remain unclear. Here, the expression of hepatitis B virus x gene (HBx) mRNA and GAS5 was assessed by qRT-PCR, and western blot analysis was performed to determine the protein expression levels. In addition, the cell viability and invasion of cells were confirmed using MTT assay and Transwell assay, respectively. The DNA methylation level of GAS5 was measured by methylation-specific PCR. Moreover, RIP assay and RNA pull down assay were carried out to examine the combination of Y-box-binding protein 1 (YBX1) and GAS5. First, our data proved that HBx is increased, while GAS5 is decreased in HCC cell lines. Subsequently, we found that HBx facilitates HCC cell viability and invasion by inhibiting GAS5 expression. Then, we further clarified that HBx induces the DNA methylation of GAS5 by promoting methyltransferase expression, thereby suppressing GAS5 expression. Furthermore, GAS5 binds YBX1 and promotes YBX1 and p21 expression. Finally, the functional analysis revealed that the upregulation of GAS5 could attenuate cell viability and invasion by boosting p21 expression via binding YBX1. Overall, our results demonstrated that HBx promotes HCC progression by inducing GAS5 methylation to reduce its expression. The upregulation of GAS5 suppressed HBV-related HCC by activating YBX1/p21 signaling. Our data provide novel evidence supporting the potential of GAS5 as a treatment target in HBV-related HCC.