ABSTRACT: Background and aims: The contribution of hepatitis B virus (HBV) infection to the aggressiveness of primary liver cancer (PLC) remains controversial. We aimed to characterize this in eastern China. Methods: We enrolled 8,515 PLC patients whose specimens were reserved at the BioBank of the hepatobiliary hospital (Shanghai, China) during 2007-2016. Of those, 3,124 who received primary radical resection were involved in survival analysis. A nomogram was constructed to predict the survivals using preoperative parameters. Results: Hepatocellular carcinoma (HCC), intrahepatic cholangiocarcinoma (ICC), and combined hepatocellular cholangiocarcinoma (CHC) accounted for 94.6, 3.7, and 1.7%, respectively. The rates of HBV infection were 87.5, 49.2, and 80.6%, respectively. HBV infection was significantly associated with 10-year earlier onset, more cirrhosis, higher ?-fetoprotein, higher carbohydrate antigen 19-9 (CA19-9), more microvascular invasion (MVI), lower neutrophil-to-lymphocyte ratio (NLR), and lower platelet-to-lymphocyte ratio (PLR) in HCC. HBV infection was also associated with 7-year earlier onset, more cirrhosis, higher ?-fetoprotein, more MVI, and lower PLR in ICC. In the multivariate Cox analysis, high circulating HBV DNA, ?-fetoprotein, CA19-9, NLR, tumor size, number, encapsulation, Barcelona Clinic Liver Cancer (BCLC) stage, and MVI predicted an unfavorable prognosis in HCC; only CA19-9 and BCLC stage, rather than HBV-related parameters, had prognostic values in ICC. A nomogram constructed with preoperative HBV-related parameters including HBV load, ultrasonic cirrhosis, and ?-fetoprotein perform better than the current staging systems in predicting postoperative survival in HCC. Conclusion: HBV promotes the aggressiveness of HCC in Chinese population. The contributions of HBV to ICC and other etiological factors to HCC might be indirect via arousing non-resolving inflammation.