Gram-negative nosocomial pneumonia may result from retrograde colonization of the pharynx from the stomach, and this may be more likely when the gastric pH is relatively high. We studied the rate of nosocomial pneumonia among 130 patients given mechanical ventilation in an intensive care unit who were receiving as prophylaxis for stress ulcer either sucralfate (n = 61), which does not raise gastric pH, or conventional treatment with antacids, histamine type 2 (H2) blockers, or both (n = 69). At the time of randomization to treatment, the two groups were similar in age, underlying diseases, and severity of acute illness. Patients in the sucralfate group had a higher proportion of gastric aspirates with a pH less than or equal to 4 (P less than 0.001) and significantly lower concentrations of gram-negative bacilli (P less than 0.05) in gastric aspirates, pharyngeal swabs, and tracheal aspirates than did patients in the antacid-H2-blocker group. The rate of pneumonia was twice as high in the antacid-H2 group as in the sucralfate group (95 percent confidence interval, 0.89 to 4.58; P = 0.11). Gram-negative bacilli were isolated more frequently from the tracheal aspirates of patients with pneumonia who were receiving antacids or H2 blockers. Mortality rates were 1.6 times higher in the antacid-H2 group than in the sucralfate group (95 percent confidence interval, 0.99 to 2.50; P = 0.07). Although our results fell just short of statistical significance when they were analyzed according to intention to treat, they suggest that agents that elevate gastric pH increase the risk of nosocomial pneumonia in patients receiving ventilation by favoring gastric colonization with gram-negative bacilli. We conclude that in patients receiving mechanical ventilation, the use of a prophylactic agent against stress-ulcer bleeding that preserves the natural gastric acid barrier against bacterial overgrowth may be preferable to antacids and H2 blockers.