Introduction: Biomarkers that predict the risk of immune-mediated adverse events (irAEs) among patients with non-small cell lung cancer (NSCLC) may reduce morbidity and mortality associated with these treatments. Methods: We carried out high resolution human leucocyte antigen (HLA)-I typing on 179 patients with NSCLC treated with anti-program death (PD)-1/program death ligand (PDL)-1. Toxicity data were collected and graded as per common terminology criteria for adverse event (CTCAE) v5.0. We used 14.8-week for landmark analysis to address lead-time bias to investigate the correlation between HLA-I/II zygosity, supertypes and alleles with irAE. Furthermore, we assessed the association for irAE with clinical benefit rate (CBR), progression-free survival (PFS) and overall survival (OS). Results: Homozygosity at one or more HLA-I loci, but not HLA-II, was associated with a reduced risk of irAE (relative risk (RR) = 0.61, 95% CI 0.33–0.95, P = 0.035) especially pneumonitis or any grade 3 toxicity. Patients with HLA-A03 supertype had a higher risk of developing irAE (RR = 1.42, 95% CI 1.02–2.01, P = 0.039). The occurrence of any irAE was significantly associated with improved CBR (RR = 1.48, P < 0.0001), PFS (HR = 0.45, P = 0.0003) and OS (HR = 0.34, P < 0.0001). Conclusions: Homozygosity at one or more HLA-I loci may serve as biomarker to predict patients who are unlikely to experience severe irAEs among patients with NSCLC and treated with anti-PD1/PDL1, but less likely to derive clinical benefit. Patients with HLA-I homozygous might benefit from additional therapy.