Background: We performed a phase II trial of pembrolizumab in patients with NSCLC or melanoma with untreated brain metastases to determine the activity of PD-1 blockade in the CNS. Interim results were previously published, and we now report an updated analysis of the full NSCLC cohort. Methods: This was an open-label, single-institution, phase 2 study. Eligible patients were ≥ 18 years of age with advanced NSCLC with ≥1 brain metastasis 5-20mm not previously treated or progressing after prior radiation, no neurologic symptoms or corticosteroid requirement, and performance status <2. Patients were treated with pembrolizumab 10 mg/kg IV every 2 weeks. Cohort 1 was for patients with PD-L1 ≥1% and cohort 2 PD-L1 <1% or unevaluable. The primary endpoint was the proportion of patients achieving a brain metastasis response. All treated patients were analyzed for response and safety endpoints. This study is closed to accrual and is registered with Clinicaltrials.gov, number NCT02085070. Here we report the updated results of the NSCLC cohort. Findings: Between March 31, 2014 and May 21, 2018, 42 patients were treated. Median followup was 8.3 months (IQR 4.5 to 26.2 months). Eleven of 37 patients in cohort 1 had a brain metastasis response (29.7% [95% CI, 15•9-47•0%]). There were no responses in cohort 2. Grade 3-4 AEs related to treatment included 2 patients with pneumonitis, and 1 each with constitutional symptoms, colitis, adrenal insufficiency, hyperglycemia, and hypokalemia. Treatment-related serious adverse events occurred in 6 (14%) patients and included pneumonitis acute kidney injury, colitis, hypokalemia, and adrenal insufficiency. There were no treatment-related deaths. Interpretation: Pembrolizumab has activity in brain metastases from NSCLC with PD-L1 expression ≥1% and is safe in select patients with untreated brain metastases. Further investigation of immunotherapy in patients with CNS disease from NSCLC is warranted.