In this cohort, we observed that the levels of CD8+ T cells, CD8+PD-L1+ T cells, and CD68+CD163+ M2 macrophages in the total region were independent prognostic factors for progression-free survival (PFS) in NSCLC patients treated with ICIs (HR=0.04, P=0.013; HR=17.70, P=0.026; and HR=17.88, P=0.011, respectively). Here, CD274 is linked to non-small cell lung carcinoma.