Kaposi sarcoma, caused by the pathogen Kaposi sarcoma-associated herpesvirus (KSHV), is the most common neoplasm for patients with AIDS. Susceptibility to KSHV has been associated with several different genetic risk variants. The purpose of this study was to test whether variants of killer cell immunoglobulin-like receptors (KIRs) and their human leukocyte antigen (HLA-I) ligands influence the risk of KSHV infection. A case-control study was performed in Xinjiang, a KSHV-endemic region of China. We recruited 299 individuals with HIV, including 123 KSHV-seropositive persons and 176 KSHV-seronegative controls. We used logistic regression and the MiDAS package to evaluate the association between KIR/HLA-I polymorphisms and KSHV infection. HLA-A*31:01, HLA-C*03:04, and HLA-C*12:03 were found to be associated with KSHV infection, with A*31:01 showing a protective effect under 3 different models (dominant: 0.30 [95% confidence interval {CI}, .08-.82], P = .031; additive: 0.30 [95% CI, .09-.80], P = .030; overdominant: 0.31 [95% CI, .09-.88], P = .042). The effect of A*31:01 might cause the variants of amino acid at HLA-A position 56, with individuals carrying an arginine having a lower KSHV infection risk. The increased homozygous KIR2DL3 was associated with a relatively high KSHV viral load (16.30% vs 41.94%, P = .010). This study provides further insight into the link between HLA-I alleles and KIR genes and KSHV infection, highlighting KSHV-susceptible variants of HLA-I and KSHV replication caused by specific KIR genotype, and revealing a potential role of KIR-mediated natural killer cell activation in anti-KSHV infection.