Remimazolam is a novel ultra-short-acting sedative, but its safety and adverse events (AEs) in high-risk patients in the intensive care unit (ICU) setting remain unknown. This was a single-center, retrospective study that compared remimazolam to propofol and midazolam in patients undergoing upper gastrointestinal endoscopy. The primary outcome was the incidence of treatment-related AEs. The secondary outcomes were the time to extubation, the length of ICU stay, and the average cost of sedative per case. Of the 88 patients analyzed, 47 were treated with remimazolam (mean dose, 7.90±4.84 mg), and 41 were treated with propofol (21.19±17.98 mg) or midazolam (3.08±2.17 mg). There was no statistically significant difference in the average duration of the endoscopic procedure (35.89±13.37 min vs. 44.51±21.68 min, P=0.133) or the time to extubation (15.00±9.75 h vs. 20.59±18.71 h, P=0.211) in the remimazolam group (group I) compared to the propofol or midazolam group (group II). ICU stays (5.40±2.93 d vs. 4.63±3.31 d, P=0.072) and treatment-related AEs (48.61% vs. 51.38%, P=0.056) were similar between groups. The average cost of sedative per case was significantly lower in the group I than in the group II (RMB 16.07±10.58 yuan vs. RMB 24.37±15.46 yuan, P=0.016). Remimazolam-based sedation was noninferior to the classic sedatives and had lower average cost per case, indicating that it may be used as a promising sedative for high-risk patients during endoscopic procedures in the ICU setting.