We present data from patients with advanced biliary tract cancer (BTC) receiving pembrolizumab in the KEYNOTE‐158 (NCT02628067; phase 2) and KEYNOTE‐028 (NCT02054806; phase 1b) studies. Eligible patients aged ≥18 years from both studies had histologically/cytologically confirmed incurable BTC that progressed after standard treatment regimen(s), measurable disease per Response Evaluation Criteria in Solid Tumors (RECIST) version 1.1, Eastern Cooperative Oncology Group performance status 0/1, and no prior immunotherapy. Programmed death ligand 1 (PD‐L1)‐positive tumors were required for eligibility in KEYNOTE‐028 only. Patients received pembrolizumab 200 mg every three weeks (KEYNOTE‐158) or 10 mg/kg every two weeks (KEYNOTE‐028) for ≤2 years. Primary efficacy endpoint was objective response rate (ORR) by RECIST v1.1. Response assessed by independent central review is reported. KEYNOTE‐158 enrolled 104 patients and KEYNOTE‐028 enrolled 24 patients. Median (range) follow‐up was 7.5 months (0.6‐34.3) in KEYNOTE‐158 and 5.7 months (0.6‐55.4) in KEYNOTE‐028. In KEYNOTE‐158, ORR was 5.8% (6/104; 95% CI, 2.1%‐12.1%); median duration of response (DOR) was not reached (NR) (range, 6.2‐26.6+ months). Median (95% CI) OS and PFS were 7.4 (5.5‐9.6) and 2.0 (1.9‐2.1) months. Among PD‐L1‐expressers (n = 61) and PD‐L1‐nonexpressers (n = 34), respectively, ORR was 6.6% (4/61) and 2.9% (1/34). In KEYNOTE‐028, ORR was 13.0% (3/23; 95% CI, 2.8%‐33.6%); median DOR was NR (range, 21.5‐53.2+ months). Median (95% CI) OS and PFS were 5.7 (3.1‐9.8) and 1.8 (1.4‐3.1) months. Grade 3 to 5 treatment‐related adverse events occurred in 13.5% of patients in KEYNOTE‐158 (no grade 4; grade 5 renal failure, n = 1) and 16.7% in KEYNOTE‐028 (no grade 4/5). In summary, pembrolizumab provides durable antitumor activity in 6% to 13% of patients with advanced BTC, regardless of PD‐L1 expression, and has manageable toxicity.