Background Patients with advanced urothelial carcinoma that progresses after platinum-based chemotherapy have a poor prognosis and limited treatment options. Methods In this open-label, international, phase 3 trial, we randomly assigned 542 patients with advanced urothelial cancer that recurred or progressed after platinum-based chemotherapy to receive pembrolizumab (a highly selective, humanized monoclonal IgG4κ isotype antibody against programmed death 1 [PD-1]) at a dose of 200 mg every 3 weeks or the investigator's choice of chemotherapy with paclitaxel, docetaxel, or vinflunine. The coprimary end points were overall survival and progression-free survival, which were assessed among all patients and among patients who had a tumor PD-1 ligand (PD-L1) combined positive score (the percentage of PD-L1-expressing tumor and infiltrating immune cells relative to the total number of tumor cells) of 10% or more. Results The median overall survival in the total population was 10.3 months (95% confidence interval [CI], 8.0 to 11.8) in the pembrolizumab group, as compared with 7.4 months (95% CI, 6.1 to 8.3) in the chemotherapy group (hazard ratio for death, 0.73; 95% CI, 0.59 to 0.91; P=0.002). The median overall survival among patients who had a tumor PD-L1 combined positive score of 10% or more was 8.0 months (95% CI, 5.0 to 12.3) in the pembrolizumab group, as compared with 5.2 months (95% CI, 4.0 to 7.4) in the chemotherapy group (hazard ratio, 0.57; 95% CI, 0.37 to 0.88; P=0.005). There was no significant between-group difference in the duration of progression-free survival in the total population (hazard ratio for death or disease progression, 0.98; 95% CI, 0.81 to 1.19; P=0.42) or among patients who had a tumor PD-L1 combined positive score of 10% or more (hazard ratio, 0.89; 95% CI, 0.61 to 1.28; P=0.24). Fewer treatment-related adverse events of any grade were reported in the pembrolizumab group than in the chemotherapy group (60.9% vs. 90.2%); there were also fewer events of grade 3, 4, or 5 severity reported in the pembrolizumab group than in the chemotherapy group (15.0% vs. 49.4%). Conclusions Pembrolizumab was associated with significantly longer overall survival (by approximately 3 months) and with a lower rate of treatment-related adverse events than chemotherapy as second-line therapy for platinum-refractory advanced urothelial carcinoma. (Funded by Merck; KEYNOTE-045 ClinicalTrials.gov number, NCT02256436 .).