Bacterial infection may adversely affect the hemostasis of patients with gastroesophageal variceal bleeding (GEVB). Antibiotic prophylaxis can prevent bacterial infection in such patients, but its role in preventing rebleeding is unclear. Over a 25-month period, patients with acute GEVB but without evidence of bacterial infection were randomized to receive prophylactic antibiotics (ofloxacin 200 mg i.v. q12h for 2 days followed by oral ofloxacin 200 mg q12h for 5 days) or receive antibiotics only when infection became evident (on-demand group). Endoscopic therapy for the GEVB was performed immediately after infection work-up and randomization. Fifty-nine patients in the prophylactic group and 61 patients in the on-demand group were analyzed. Clinical and endoscopic characteristics of the gastroesophageal varices, time to endoscopic treatment, and period of follow-up were not different between the two groups. Antibiotic prophylaxis decreased infections (2/59 vs. 16/61; P <.002). The actuarial probability of rebleeding was higher in patients without prophylactic antibiotics (P =.0029). The difference of rebleeding was mostly due to early rebleeding within 7 days (4/12 vs. 21/27, P =.0221). The relative hazard of rebleeding within 7 days was 5.078 (95% CI: 1.854-13.908, P <.0001). The multivariate Cox regression indicated bacterial infection (relative hazard: 3.85, 95% CI: 1.85-13.90) and association with hepatocellular carcinoma (relative hazard: 2.46, 95% CI: 1.30-4.63) as independent factors predictive of rebleeding. Blood transfusion for rebleeding was also reduced in the prophylactic group (1.40 +/- 0.89 vs. 2.81 +/- 2.29 units, P <.05). There was no difference in survival between the two groups. In conclusion, antibiotic prophylaxis can prevent infection and rebleeding as well as decrease the amount of blood transfused for patients with acute GEVB following endoscopic treatment.