Background and objectiveThe association between infection and acute ischemic stroke (AIS) with diabetes mellitus (DM) remains unknown. Therefore, this study aimed to explore the effect of infection on AIS with DM.Materials and methodsThe data of patients with AIS and DM were extracted from the Chinese Stroke Center Alliance (CSCA) database from August 2015 to July 2019. The association between infections [pneumonia or urinary tract infection (UTI)] and in-hospital mortality was analyzed. Logistic regression models were used to identify the risk factors for in-hospital mortality of patients with infection.ResultsIn total, 1,77,923 AIS patients with DM were included in the study. The infection rate during hospitalization was 10.5%, and the mortality rate of infected patients was 3.4%. Stroke-associated infection was an independent risk factor for an early poor functional outcome [odds ratio (OR) = 2.26, 95% confidence interval (CI): 1.97–2.34, P < 0.0001] and in-hospital mortality in AIS patients with DM. The in-hospital mortality after infection was associated with age (OR = 1.02, 95% CI: 1.01–1.03, P < 0.0001), male (OR = 1.39, 95% CI: 1.13–1.71, P = 0.0018), reperfusion therapy (OR = 2.00, 95% CI: 1.56–2.56, P < 0.0001), and fasting plasma glucose at admission (OR = 1.05, 95% CI: 1.03–1.08, P < 0.0001). In contrast, antiplatelet drug therapy (OR = 0.63, 95% CI: 0.50–0.78, P < 0.0001) and hospital stay (OR = 0.96, 95% CI: 0.94–0.97, P < 0.0001) were independent protecting factors against in-hospital mortality of patients with infection.ConclusionInfection is an independent risk factor of in-hospital mortality for patients with AIS and DM, and those patients require strengthening nursing management to prevent infection.