Abstract Background: The reported associations of genetic variants within the human leukocyte antigen (HLA) region with hepatis B virus (HBV)-related hepatocellular carcinoma (HCC) are not consistent, and the structure-function patterns involved in this disease remain unclear. Methods: Utilizing genotype data from 706 HBV-related HCC cases and 6197 chronic HBV carriers without HCC collected from three resources in Taiwan, we imputed the classical HLA alleles at 2-field resolution and analyzed the molecular landscape of HLA complexes by deeply dissecting their genotypic configurations, functional divergence, and HBV-antigen binding capabilities in associations with the HCC risk. Logistic regression models were used, and all models were adjusted for sex, age, and population structure using the top 10 principal components. We also tested the underlying biological implications of our findings by investigating the HLA binding affinities and HLA effect on control of viral replication (i.e, HBV DNA load), viral population diversity (i.e, quasispecies), and inflammation (i.e, chemokines, cytokines, and soluble programmed cell death 1 [sPD-1]-associated T cell exhaustion). Results: We found high accuracy (≥95% concordance) of HLA imputation at all HLA class I and class II alleles. The strongest evidence for an association with HCC was observed for HLA-DQB1*03:01 (adjusted OR= 1.35 in an additive genetic model, P=1.3×10-6). Three amino acids at specific positions within or near the peptide-binding groove of DQB1 molecules might explain the observed allele association, which leads to loss of binding HBV nucleocapsid protein (i.e., low binding affinity predicted by NetMHCIIpan 4.0 for HLA-DQB1*03:01). HLA-DQB1*03:01 was significantly associated with a higher HBV DNA load (P= 4.3×10-4) and an increased level of serum sPD-1 (P=6.8×10-4), but not with increased levels of chemokines, cytokines, and viral complexity (i.e., Shannon entropy for HBV quasispecies, all P values>0.05). Analysis of HLA zygosity confirmed that HLA-DQB1 heterozygosity was associated with a decreased risk of HCC (adjusted OR=0.77, P= 0.015). Analysis of HLA evolutionary divergence (HED) showed that high HED at HLA-DRB1 loci was marginally associated with a decreased risk of HCC among HLA-DQB1*03:01 non-carriers (P=0.05). Conclusion: Our data shed light on the immunogenetic risk associated with HBV-related HCC. The effect of HLA-DQB1*03:01 could be partly explained by its low binding affinity with HBV nucleocapsid antigen, and/or its effect on viral load control and sPD-1, but not by its control on other inflammation markers (chemokines and cytokines) and viral population diversity. The association between HLA-DQB1 heterozygosity and HCC risk could be independent of the HLA-DQB1*03:01 effect, which indicates underlying mechanisms related to increased immunosurveillance in clearing potential viral antigens or neoantigens. Citation Format: Zhiwei Liu, Chih-Jen Huang, Yu-Han Huang, Mei-Hung Pan, Mei-Hsuan Lee, Mathias Viard, Allan Hildesheim, Ruth M. Pfeiffer, Mary Carrington, Chien-Jen Chen, Tobias L. Lenz, Hwai-I Yang. The immunogenetic basis of hepatitis B virus-related hepatocellular carcinoma [abstract]. In: Proceedings of the American Association for Cancer Research Annual Meeting 2023; Part 1 (Regular and Invited Abstracts); 2023 Apr 14-19; Orlando, FL. Philadelphia (PA): AACR; Cancer Res 2023;83(7_Suppl):Abstract nr 3013.