With the revolutionary progress of immune checkpoint inhibitors (ICIs) in non–small cell lung cancer, identifying patients with cancer who would benefit from ICIs has become critical and urgent. Here, we report protein tyrosine phosphatase receptor type T (PTPRT) loss as a precise and convenient predictive marker independent of PD-L1 expression for anti–PD-1/PD-L1 axis therapy. Anti–PD-1/PD-L1 axis treatment markedly increased progression-free survival in patients with PTPRT-deficient tumors. PTPRT-deficient tumors displayed cumulative DNA damage, increased cytosolic DNA release, and higher tumor mutation burden. Moreover, the tyrosine residue 240 of STING was identified as a direct substrate of PTPRT. PTPRT loss elevated phosphorylation of STING at Y240 and thus inhibited its proteasome-mediated degradation. PTPRT-deficient tumors released more IFN-β, CCL5, and CXCL10 by activation of STING pathway and increased immune cell infiltration, especially of CD8 T cells and natural killer cells, ultimately enhancing the efficacy of anti–PD-1 therapy in multiple subcutaneous and orthotopic tumor mouse models. The response of PTPRT-deficient tumors to anti–PD-1 therapy depends on the tumor-intrinsic STING pathway. In summary, our findings reveal the mechanism of how PTPRT-deficient tumors become sensitive to anti–PD-1 therapy and highlight the biological function of PTPRT in innate immunity. Considering the prevalence of PTPRT mutations and negative expression, this study has great value for patient stratification and clinical decision-making.