To evaluate the effects and safety of stress ulcer prophylaxis (SUP) versus no prophylaxis in adult septic patients at risk of gastrointestinal bleeding (GIB). A retrospective cohort study was conducted, the data was extracted from Electronic Intensive Care Unit-Collaborative Research Database (eICU-CRD). All patients who received proton pump inhibitor (PPI) or H2 receptor antagonist (H2RA) or combined/sequential use for SUP within the first 48 hours of intensive care unit (ICU) admission were enrolled in the SUP group, those who did not received any SUP were enrolled in the non-SUP group. The differences of in-hospital mortality, length of ICU stay (LOS), the incidence of GIB and secondary infection complications between the two groups were compared. Propensity score matching (PSM) was conducted to balance the distributions of study variables between the two groups. Further subgroup analysis was performed according to whether SUP was used for more than 3 days. Multivariate Logistic regression analysis was conducted to analyze the factors influencing the outcome of GIB and secondary pneumonia. A total of 11 413 patients were included in the final analysis, with 9 799 patients in SUP group and 1 614 in non-SUP group. A 1:1 PSM created 1 600 patients in each cohort. (1) Baseline characteristics: compared with SUP group, patients in non-SUP group were older [years old: 69.0 (56.0, 80.0) vs. 67.0 (56.0, 78.0)], acute physiology and chronic health evaluation IV (APACHE IV) score and sequential organ failure assessment (SOFA) score were significantly lower [APACHE IV score: 65 (50, 73) vs. 72 (58, 87), SOFA score: 5 (4, 7) vs. 7 (5, 9)], higher rates of underlying diseases such as hypertension and diabetes [hypertension: 15.6% (252/1 614) vs. 12.2% (1 196/9 779), diabetes: 4.5% (72/1 614) vs. 3.3% (325/9 779), both P < 0.05], indicating that patients in the SUP group were more severe. (2) Comparison of clinical outcome: before PSM, SUP group had significantly higher in-hospital mortality [17.2% (1 688/9 799) vs. 10.9% (176/1 614)], longer LOS [days: 4.4 (2.9, 7.7) vs. 3.1 (2.5, 4.3)], and higher incidence of secondary pneumonia than non-SUP group [11.3% (1 112/9 799) vs. 6.8% (110/1 614)], with significant differences (all P < 0.05). There was no significant difference in the incidence of GIB and Clostridium difficile infection (CDI) between the two groups. After PSM, no significant differences were observed between the two groups with regard to in-hospital mortality, incidence of GIB and CDI. However, the SUP group had longer LOS [days: 3.9 (2.8, 6.6) vs. 3.1 (2.5, 4.3)], and higher incidence of secondary pneumonia [10.9% (174/1 600) vs. 6.8% (108/1 600)] compared with non-SUP group, the differences were statistically significant (all P < 0.05). Subgroup analysis showed that compared with SUP < 3 days group, patients in SUP ≥ 3 days group had higher disease severity score [APACHE IV score: 66 (51, 79) vs. 62 (48, 72), SOFA score: 6 (4, 8) vs. 5 (4, 7), both P < 0.05], in addition, patients in SUP ≥ 3 days group had higher in-hospital mortality, incidence of GIB and secondary pneumonia (16.4% vs. 10.7%, 6.1% vs. 1.8%, 19.0% vs. 8.6%, respectively), and longer ICU LOS [days: 6.6 (4.1, 11.8) vs. 3.5 (2.6, 5.3), all P < 0.05]. (3) Multivariate Logistic regression analysis showed that SUP ≥ 3 days group was associated with more GIB than that of non-SUP group [odds ratio (OR) = 1.84, 95% confidence interval (95%CI) was 1.07-3.08, P = 0.030], and the incidence of GIB was less in SUP < 3 days group than that of non-SUP group (OR = 0.57, 95%CI was 0.34-0.94, P = 0.020). When compared with non-SUP group, the risk of secondary pneumonia was increased both in SUP ≥ 3 days group and SUP < 3 days group (OR values were 2.95 and 1.34, 95%CI were 2.10-4.13 and 1.01-1.77, P values were < 0.001 and 0.040, respectively). Among critically ill adult patients with sepsis at risk for GIB, SUP showed no effect on reducing in-hospital mortality, the rate of GIB and CDI, but was associated with increased risk of secondary pneumonia and prolonged LOS.