Importance:With improved survival, heart failure (HF) has become a major complication for individuals with human immunodeficiency virus (HIV) infection. It is unclear if this risk extends to different types of HF in the antiretroviral therapy (ART) era. Determining whether HIV infection is associated with HF with reduced ejection fraction (HFrEF), HF with preserved ejection fraction (HFpEF), or both is critical because HF types differ with respect to underlying mechanism, treatment, and prognosis. Objectives:To investigate whether HIV infection increases the risk of future HFrEF and HFpEF and to assess if this risk varies by sociodemographic and HIV-specific factors. Design, Setting, and Participants:This study evaluated 98 015 participants without baseline cardiovascular disease from the Veterans Aging Cohort Study, an observational cohort of HIV-infected veterans and uninfected veterans matched by age, sex, race/ethnicity, and clinical site, enrolled on or after April 1, 2003, and followed up through September 30, 2012. The dates of the analysis were October 2015 to November 2016. Exposure:Human immunodeficiency virus infection. Main Outcomes and Measures:Outcomes included HFpEF (EF≥50%), borderline HFpEF (EF 40%-49%), HFrEF (EF<40%), and HF of unknown type (EF missing). Results:Among 98 015 participants, the mean (SD) age at enrollment in the study was 48.3 (9.8) years, 97.0% were male, and 32.2% had HIV infection. During a median follow-up of 7.1 years, there were 2636 total HF events (34.6% were HFpEF, 15.5% were borderline HFpEF, 37.1% were HFrEF, and 12.8% were HF of unknown type). Compared with uninfected veterans, HIV-infected veterans had an increased risk of HFpEF (hazard ratio [HR], 1.21; 95% CI, 1.03-1.41), borderline HFpEF (HR, 1.37; 95% CI, 1.09-1.72), and HFrEF (HR, 1.61; 95% CI, 1.40-1.86). The risk of HFrEF was pronounced in veterans younger than 40 years at baseline (HR, 3.59; 95% CI, 1.95-6.58). Among HIV-infected veterans, time-updated HIV-1 RNA viral load of at least 500 copies/mL compared with less than 500 copies/mL was associated with an increased risk of HFrEF, and time-updated CD4 cell count less than 200 cells/mm3 compared with at least 500 cells/mm3 was associated with an increased risk of HFrEF and HFpEF. Conclusions and Relevance:Individuals who are infected with HIV have an increased risk of HFpEF, borderline HFpEF, and HFrEF compared with uninfected individuals. The increased risk of HFrEF can manifest decades earlier than would be expected in a typical uninfected population. Future research should focus on prevention, risk stratification, and identification of the mechanisms for HFrEF and HFpEF in the HIV-infected population.