Objectives Dysglycemia is associated with poor outcomes in critically ill patients,which is uncertain in patients with diabetes regarding to the situation of glucose control before hospitalization. This study was aimed to investigate the effect of the difference between the level of blood glucose during ICU stay and before admission to ICU upon the outcomes of critically ill patients with diabetes. Method Patients with diabetes expected to stay for more than 24hs were enrolled, HbA1c was converted to A1C-derived average glucose (ADAG) by the equation: ADAG = [ (HbA1c * 28.7) – 46.7 ] * 18−1, blood glucose were measured four times a day during the first 7 days after admission, the mean glucose level(MGL) and SOFA (within 3, 5, and 7days) were calculated for each person, GAPadm and GAPmean was calculated as admission blood glucose and MGL minus ADAG, the incidence of moderate hypoglycemia(MH), severe hypoglycemia (SH), total dosage of glucocorticoids and average daily dosage of insulin, duration of renal replacement therapy(RRT), ventilator-free hours, and non-ICU days were also collected. Patients were divided into survival group and nonsurvival group according to survival or not at 28-day, the relationship between GAP and mortality were analyzed. Results 431 patients were divided into survival group and nonsurvival group. The two groups had a comparable level of HbA1c, the nonsurvivors had greater APACHE II, SOFA, GAPadm, GAPmean-3, GAPmean-5, GAPmean-7 and higher MH and SH incidences. Less duration of ventilator-free, non-ICU stay and longer duration of RRT were recorded in the nonsurvival group. GAPmean-5 had the greatest predictive power with an AUC of 0.807(95%CI: 0.762-0.851), the cut-off value was 3.6 mmol/L (sensitivity 77.7% and specificity 76.6%). The AUC was increased to 0.852(95%CI: 0.814-0.889) incorporated with SOFA5 (NRI = 11.34%). Conclusion Glycemic GAP between the MGL within 5 days and ADAG was independently associated with 28-day mortality of critically ill patients with diabetes. The predictive power was optimized with addition of SOFA5.