Background: Chronic hepatitis B virus (HBV) infection is a great health burden with geographical variations. Aims: To explore genetic variants associated with chronic HBV infection. Methods: The study included 15 352 participants seropositive for HBV core antibodies in Taiwan Biobank. Among them, 2591 (16.9%) seropositive for HBV surface antigen (HBsAg) were defined as having chronic HBV infection. All participants were examined for whole-genome genotyping by Axiom-Taiwan Biobank Array. The human leucocyte antigen (HLA) imputation was performed after identification of the variants within the region. Logistic regressions were used to estimate odds ratios (ORs) with 95% confidence intervals. Correlations of different HLA allele frequencies with HBsAg seroprevalence were evaluated across worldwide populations by Pearson correlation coefficients. Epitope prediction was performed for HLA alleles using NetMHCIIpan method. Results: Located within a cluster of 450 single nucleotide polymorphisms in HLA class II, rs7770370 (P = 2.73 × 10−35) was significantly associated with HBV chronicity (Pcorrected < 8.6 × 10−8). Imputation analyses showed that HLA-DPA1*02:02 and HLA-DPB1*05:01 were associated with chronic HBV, with adjusted ORs of 1.43 (1.09-1.89) and 1.61 (1.29-2.01). These allele frequencies were positively correlated with global HBsAg seroprevalence, with R of 0.75 and 0.62 respectively (P < 0.05). HLA-DRB1*13:02, HLA-DQA1* 01:02 and HLA-DQB1*06:09 associated with HBV chronicity negatively, with adjusted ORs of 0.31 (0.17-0.58), 0.70 (0.56-0.87) and 0.33 (0.18-0.63). These HLA alleles had various binding affinities to the predicted epitopes derived from HBV nucleocapsid protein. Conclusions: HLA class II variants are relevant for chronicity after HBV acquisition.