Cancer Immunotherapy Trials Network 12 demonstrated safety of pembrolizumab in treating advanced cancer in people with HIV. Here, we report results of the Kaposi sarcoma (KS) cohort. In this multicenter phase I trial, we enrolled participants with HIV-associated KS on antiretroviral therapy with CD4+ ≥50 cells/μL and HIV plasma RNA <200 copies/mL. Pembrolizumab 200 mg intravenously was administered once every 3 weeks for up to 35 cycles. The primary end point was safety, and the secondary end point was KS response by modified AIDS Clinical Trials Group Criteria. Thirty-two cisgender men enrolled with baseline median CD4+ T-cell count of 274 cells/µL. All but nine participants had received previous systemic KS therapy. Participants received a median of 11 cycles of pembrolizumab (range, 1-35). Sixty-six percent had grade ≥1 treatment-emergent adverse events, including one death from polyclonal KS herpesvirus-related B-cell lymphoproliferation. Thirty-one percent had ≥one immune-mediated AEs (imAEs) with 25% requiring systemic steroids. In 29 participants with evaluable KS, the overall response rate (ORR) was 62.1% (95% CI, 42.3 to 79.3) and did not differ by CD4+ T-cell count. ORR in the eight participants with evaluable disease without previous KS therapy was 87.5% (95% CI, 47.3 to 99.7). Median duration of response (DOR) was not reached, and the Kaplan-Meier estimate of DOR of ≥12 months was 92.3% (95% CI, 56.6 to 98.8). Median progression-free survival was 28.2 months (95% CI, 4.2 to noncalculable). Pembrolizumab yielded a high rate of durable responses in HIV-associated KS. imAEs were successfully managed with standard guidelines.