To investigate factors affecting upper gastrointestinal bleeding (UGIB) in elderly first-time acute stroke patients undergoing rehabilitation. Three hundred and thirty-one elderly first-time acute stroke patients (age ≥65 years) transferred to our rehabilitative ward from July 2002 to June 2009 were included in the study. We divided patients into UGIB and non-UGIB groups. Demographic data and possible precipitating factors were analyzed. Sixty-eight (20.5%) patients experienced UGIB. The patients with UGIB were of older age (75.4 vs. 72.92 years, P = 0.003), had a longer rehabilitative ward stay (26.32 vs. 21 days, P = 0.002), more frequently had stroke-induced consciousness impairment (60.3 vs. 38%, P = 0.001), had a higher incidence of bilateral brain lesion (7.4 vs. 1.9%, P = 0.034), and more frequently used anticoagulants (17.6 vs. 9.1%, P = 0.044) than patients in the non-UGIB group. In multivariate logistic regression analysis, stroke-induced impaired consciousness (odds ratio: 2.806, 95% CI = 1.588-4.957, P = 0.000) was the most important risk factor for UGIB. UGIB may prolong a patient's length of stay in a rehabilitative ward. These identified factors may help clinicians identify risks of UGIB before it develops.