ObjectiveTo describe trends in the prevalence of diabetes among hospitalized HIV-infected patients between 1997 and 2012 in Spain and compare them with those of age- and sex-matched non–HIV-infected patients.MethodsThe study was based on Spanish national hospital discharge data. We performed a retrospective study for the period 1997–2012. HIV infection (HIV-infected versus non–HIV-infected [control group])and calendar period in relation to widespread use of combination antiretroviral therapy (cART) (1997–1999; 2000–2003; 2004–2007 and 2008–2012), were the exposure variables The outcome variables were diagnosis of diabetes and in-hospital mortality (IHM).ResultsFrom 1997 to 2012, we identified 91,752 cases of diabetes: 15,398 in the HIV-infected group (403,277 hospital admissions) and 76,354 in the non–HIV-infected group (1,503,467 hospital admissions). Overall, HIV-infected patients had lower prevalence values for diabetes than non–HIV-infected patients throughout the follow-up (3.8% vs. 5.1%; p<0.001). The prevalence of diabetes increased 1.56-fold among non–HIV-infected patients and 4.2-fold among HIV-infected patients. The prevalence of diabetes in females was almost twice as high in HIV-infected patients as in non–HIV-infected patients during the last study period (4.72% vs. 2.88%; p<0.001). Diabetes showed a protective effect against IHM throughout the study period (aOR = 0.70; 95%CI, 0.65–0.75).ConclusionsDuring the cART era, the prevalence of diabetes has increased sharply among HIV-infected hospitalized patients compared with matched non–HIV-infected subjects. The prevalence of diabetes is rising very fast among HIV-infected women. Diabetes has a protective effect on IHM among HIV-infected patients. Nevertheless, our study has several limitations. No information is available in the database used on important sociodemographic characteristics and relevant clinical variables including duration of the HIV infection, treatments used, drug resistance, treatment adherence or CD4 count, among others. Also, it is possible that increase of diabetes prevalence could reflect the improvement in recording habits.