PURPOSE: Compared with people living without HIV (PWOH), people living with HIV (PWH) and cancer have traditionally been excluded from immune checkpoint inhibitor (ICI) trials. Furthermore, there is a paucity of real-world data on the use of ICIs in PWH and cancer. METHODS: This retrospective study included PWH treated with anti-PD-1- or anti-PD-L1-based therapies for advanced cancers. Kaplan-Meier method was used to estimate overall survival (OS) and progression-free survival (PFS). Objective response rates (ORRs) were measured per RECIST 1.1 or other tumor-specific criteria, whenever feasible. Restricted mean survival time (RMST) was used to compare OS and PFS between matched PWH and PWOH with metastatic NSCLC (mNSCLC). RESULTS: Among 390 PWH, median age was 58 years, 85% (n = 331) were males, 36% (n = 138) were Black; 70% (n = 274) received anti-PD-1/anti-PD-L1 monotherapy. Most common cancers were NSCLC (28%, n = 111), hepatocellular carcinoma ([HCC]; 11%, n = 44), and head and neck squamous cell carcinoma (HNSCC; 10%, n = 39). Seventy percent (152/216) had CD4+ T cell counts ≥200 cells/µL, and 94% (179/190) had HIV viral load <400 copies/mL. Twenty percent (79/390) had any grade immune-related adverse events (irAEs) and 7.7% (30/390) had grade ≥3 irAEs. ORRs were 69% (nonmelanoma skin cancer), 31% (NSCLC), 16% (HCC), and 11% (HNSCC). In the matched mNSCLC cohort (61 PWH v 110 PWOH), 20% (12/61) PWH and 22% (24/110) PWOH had irAEs. Adjusted 42-month RMST difference was -0.06 months (95% CI, -5.49 to 5.37; P = .98) for PFS and 2.23 months (95% CI, -4.02 to 8.48; P = .48) for OS. CONCLUSION: Among PWH, ICIs demonstrated differential activity across cancer types with no excess toxicity. Safety and activity of ICIs were similar between matched cohorts of PWH and PWOH with mNSCLC.