Background: The factors that predict the clinical response to ramucirumab plus docetaxel (RD) after first‐line chemoimmunotherapy are unresolved. We explored whether the therapeutic efficacy of prior chemoimmunotherapy could predict the outcome of RD as sequential therapy in patients with advanced non‐small cell lung cancer (NSCLC). Methods: Our study comprised 288 patients with advanced NSCLC who received RD as the second‐line treatment after first‐line chemoimmunotherapy at 62 Japanese institutions. Chemoimmunotherapy consisted of a platinum‐based regimen and immune checkpoint inhibitors (ICIs). The association between several variables and the therapeutic outcome of RD was determined via logistic regression analysis. Results: Of the 288 patients, 225 (78.1%) received maintenance therapy and 108 (37.5%) received both ICI treatment for >180 days and maintenance therapy. All of 108 patients having ICIs for >180 days received maintenance therapy. Univariate analysis identified performance status, histology (adenocarcinoma), maintenance therapy, and ICI treatment >180 days as significant predictors of better progression‐free survival (PFS) and overall survival (OS) after RD administration. Multivariate analysis confirmed that these factors independently predicted favorable PFS and OS. The therapeutic response and PD‐L1 expression were not closely associated with outcome after RD treatment. In particular, maintenance therapy >4 cycles was more predictive of the better prognosis for RD treatment. Conclusion: Extended ICI treatment after chemoimmunotherapy and maintenance therapy enhanced the efficacy of second‐line RD treatment in patients with advanced NSCLC. [ABSTRACT FROM AUTHOR]