ImportanceImmune-related adverse events (irAEs) secondary to immune checkpoint inhibitor (ICI) therapy reportedly improve overall survival (OS) in patients with non–small cell lung cancer (NSCLC). However, studies have been small and the association between irAE severity and OS remains poorly defined.ObjectiveTo examine the association between irAEs and their severity with OS in patients with locally advanced or metastatic NSCLC receiving ICIs.Design, Setting, and ParticipantsThis retrospective observational cohort study included patients with NSCLC receiving ICIs between March 1, 2014, and November 30, 2021, with follow-up until March 31, 2023. Data analysis was completed April 26, 2023. The Alberta Immunotherapy Database, a provincial, multicenter cohort, was used to capture data from patients receiving ICIs in Alberta, Canada. Participants included 803 patients 18 years or older who received at least 1 cycle of ICI (alone or with chemotherapy), agnostic to treatment line.ExposureDeveloping an irAE mandating delay or discontinuation of ICI therapy and/or systematic corticosteroids for management of toxic effects (hereinafter referred to as clinically meaningful irAEs).Main Outcomes and MeasuresThe primary outcome was association between irAEs and OS according to Kaplan-Meier analysis. Clinically meaningful irAEs were identified. Patients with poor prognosis (survival <3 months) who may have died prior to irAE development were excluded from OS analysis, mitigating immortal time bias. Adjusted Cox proportional hazards regression analyses ascertained variables associated with OS.ResultsAmong the 803 patients included in the analysis, the median age of patients with irAEs was 69.7 (IQR, 63.1-75.2) years and the median age of those without irAEs was 67.5 (IQR, 60.4-73.3) years, with comparable sex distribution (139 of 295 men [47.1%] and 156 of 295 women [52.9%] with irAEs vs 254 of 505 men [50.3%] and 251 of 505 women [49.7%] without irAEs). Mitigating immortal time bias (n = 611), irAEs were associated with OS (median OS with irAEs, 23.7 [95% CI, 19.3-29.1] months; median OS without irAEs, 9.8 [95% CI, 8.7-11.4] months; P < .001). No OS difference was associated with treatment in hospital vs as outpatients for an irAE (median OS, 20.8 [95% CI, 11.7-30.6] vs 25.6 [95% CI, 20.1-29.8] months; P = .33). Developing irAEs remained associated with OS in the total cohort after Cox proportional hazards regression with known prognostic characteristics (hazard ratio, 0.53 [95% CI, 0.40-0.70]; P < .001).Conclusions and RelevanceIn this cohort study of 803 patients with locally advanced or metastatic NSCLC receiving ICIs, developing a clinically meaningful irAE was associated with improved OS. This association was not compromised by hospitalization for severe toxic effects. Whether and how ICI therapy resumption after an irAE is associated with OS warrants further study.