To determine the association of HIV infection and immunodeficiency with incidence of ischemic stroke. Cohort study of HIV-positive and matched HIV-negative adult Kaiser Permanente Northern and Southern California (KPNC and KPSC, respectively) members during 1996-2011 (KPNC) or 2000-2011 (KPSC). We used Poisson models to obtain rate ratios for incident ischemic stroke associated with HIV infection, both overall and stratified by CD4 cell counts (cells/?l) and HIV RNA copies (copies/ml), with HIV-negative individuals as the reference group. We also obtained rate ratios for risk factors in the HIV-positive subset. Among 24,768 HIV-positive and 257,600 HIV-negative individuals, the ischemic stroke rate per 100,000 person-years was 125 (n = 151 events) for HIV-positive and 74 (n = 1128 events) for HIV-negative individuals, with an adjusted rate ratio of 1.4 [95% confidence interval (CI) 1.2-1.7). Compared with HIV-negative individuals, HIV-positive individuals with recent CD4 cell counts of 500 cells/?l at least (rate ratio 1.0, 95% CI 0.8-1.4) or recent HIV RNA less than 500 copies/ml (rate ratio 1.1, 95% CI 0.9-1.4) had no excess risk of ischemic stroke, with similar results for HIV-positive individuals with nadir CD4 cell counts of 500 cells/?l at least (rate ratio 1.4, 95% CI 0.8-2.2) or 200-499 cells/?l (rate ratio 1.2, 95% CI 0.9-1.5). Among HIV-positive individuals only, recent CD4 cell count less than 200 cells/?l (rate ratio 2.5, 95% CI 1.3-4.6) was associated with an increased risk of ischemic stroke after adjustment for recent HIV RNA and nadir CD4 cell count, whereas recent HIV RNA and nadir CD4 were not independent risk factors. Ischemic stroke incidence in HIV-positive individuals with high CD4 cell count or low HIV RNA is similar to that of HIV-negative individuals.