Background: Upper gastrointestinal bleeding (UGIB) is a common complication of acute ischemic stroke (AIS), but the effect of UGIB on the prognosis of middle-aged AIS patients is not clear.Methods: Patients with AIS admitted to our hospital from January 2011 to December 2015 were eligible to be included in this study. All included patients were divided into UGIB and non-UGIB groups. Some clinical characteristics were retrospectively collected. Primary outcomes were all-cause mortality within 1, 3, and 5 years, as well as the incidence of stroke recurrence. Cox proportional hazards regression analyses were used to determine the effect of UGIB on 5-year mortality and the incidence of stroke recurrence. Logistic regression was also used to identify the predictors of UGIB in AIS patients.Results: A total of 405 AIS patients were included in this study and then divided into UGIB and non-UGIB groups. The mean age of the UGIB group and non-UGIB group was 61.5±9.6 and 53.1±14.0 years, respectively (P<0.001). The baseline score of the National Institute of Health Stroke Scale (NIHSS) was significantly higher in the UGIB group than in the non-UGIB group (P<0.001). AIS patients in the UGIB group had a higher 1-, 3-, and 5-year mortality and a higher incidence of stroke recurrence (all P<0.001).Kaplan-Meier curves showed that AIS patients with UGIB had a higher 5-year mortality and a higher incidence of stroke recurrence (both P<0.001). Cox proportional hazards regression models indicated that the occurrence of UGIB, older age, a high NIHSS score, and stroke recurrence were related to a higher 5-year mortality. Similarly, the occurrence of UGIB, older age, a high NIHSS score, and hypertension increased the incidence of stroke recurrence. According to the multivariate logistic regression analysis, older age, a high NIHSS score, and previous anticoagulant use were identified as predictors of UGIB.Conclusions: UGIB has important effects on the prognosis of AIS patients. The incidence of UGIB increases with older age, a high NIHSS score, and previous anticoagulant use, which provides important evidence for the treatment and nursing of AIS patients.