Background More than half of all patients with advanced urothelial cancer cannot receive standard, first-line cisplatin-based chemotherapy because of renal dysfunction, poor performance status, or other comorbidities. We assessed the activity and safety of first-line pembrolizumab in cisplatin-ineligible patients with locally advanced and unresectable or metastatic urothelial cancer. Methods In this multicentre, single-arm, phase 2 study (KEYNOTE-052), cisplatin-ineligible patients with advanced urothelial cancer who had not been previously treated with systemic chemotherapy were recruited from 91 academic medical centres in 20 countries. Enrolled patients received intravenous pembrolizumab 200 mg every 3 weeks. The primary endpoint was objective response (the proportion of patients who achieved complete or partial response) in all patients and by PD-L1 expression status according to the Response Evaluation Criteria in Solid Tumors, version 1.1, as assessed by independent central review. PD-L1 expression was assessed in tumour and inflammatory cells from tumour biopsies provided at study entry. Activity and safety were analysed in all patients who received at least one dose of pembrolizumab (all-patients-treated population). This study is registered with ClinicalTrials.gov, number NCT02335424, and follow-up is ongoing. Findings Between Feb 24, 2015, and Aug 8, 2016, 374 patients were enrolled and 370 patients received at least one dose of pembrolizumab. 89 (24%, 95% CI 20–29) of 370 patients had a centrally assessed objective response, and as of Sept 1, 2016 (data cutoff), 74 (83%) of 89 responses were ongoing. Median follow-up was 5 months (IQR 3·0–8·6). A PD-L1-expression cutoff of 10% was associated with a higher frequency of response to pembrolizumab; 42 (38%, 95% CI 29–48) of 110 patients with a combined positive score of 10% or more had a centrally assessed objective response. The most common grade 3 or 4 treatment-related adverse events were fatigue (eight [2%] of 370 patients), alkaline phosphatase increase (five [1%]), colitis, and muscle weakness (both four [1%]). 36 (10%) of 370 patients had a serious treatment-related adverse event. 17 (5%) of 370 patients died from non-treatment-related adverse events associated with death, and one patient died from treatment-related adverse events (myositis in addition to grade 3 thyroiditis, grade 3 hepatitis, grade 3 pneumonia, and grade 4 myocarditis). Interpretation First-line pembrolizumab has antitumour activity and acceptable tolerability in cisplatin-ineligible patients with urothelial cancer, most of whom were elderly, had poor prognostic factors, or had serious comorbidities. In view of this result, pembrolizumab has become a new treatment option for patients who are cisplatin-ineligible or not suitable candidates for chemotherapy. Pembrolizumab in the first-line setting is being further assessed in the phase 3 KEYNOTE-361 trial (ClinicalTrials.gov, NCT02335424). Funding Merck & Co.