Objective. To estimate cause of death and to identify factors associated with risk of inhospital mortality among patients with T2D. Methods. Prospective cohort study performed in a referral public hospital in Lima, Peru. The outcome was time until event, elapsed from hospital admission to discharge or death, and the exposure was the cause of hospital admission. Cox regression was used to evaluate associations of interest reporting Hazard Ratios (HR) and 95% confidence intervals. Results. 499 patients were enrolled. Main causes of death were exacerbation of chronic renal failure (38.1%), respiratory infections (35.7%), and stroke (16.7%). During hospital stay, 42 (8.4%) patients died. In multivariable models, respiratory infections (HR = 6.55, p < 0.001), stroke (HR = 7.05, p = 0.003), and acute renal failure (HR = 16.9, p = 0.001) increased the risk of death. In addition, having 2+ (HR = 7.75, p < 0.001) and 3+ (HR = 21.1, p < 0.001) conditions increased the risk of dying. Conclusion. Respiratory infections, stroke, and acute renal disease increased the risk of inhospital mortality among hospitalized patients with T2D. Infections are not the only cause of inhospital mortality. Certain causes of hospitalization require standardized and aggressive management to decrease mortality.