A pharmaceutical composition comprising proton pump inhibitors and prebiotics is proposed for the treatment of gastric and duodenal ulcer, this allowing effective ulcer treatment and eradication of H. pylori from the gastric and duodenal mucosa to be carried out without using wide-spectrum antibiotics. The comprehensive treatment of ulcer disease associated with a helicobaterial infection using a pharmaceutical composition of a PPI and a prebiotic makes it possible, in conditions of an elevated pH of the stomach contents, actively to stimulate the growth of lactobacilli in the upper sections of the gastrointestinal tract, including the duodenum, and substantially to increase the titre of lactobacilli, which are antagonists of H. pylori, which greatly improves the effectiveness of the ulcer treatment. The high clinical effectiveness and safety resulting from the synergistic action of the proton pump inhibitor and the prebiotic in the upper sections of the gastrointestinal tract, the absence of side effects and recurrences, and also the level of compliance to the combined treatment provided by the claimed pharmaceutical composition indicate that the proposed formulation is a promising new means for the treatment of gastric and duodenal ulcer. Use of the claimed composition dramatically reduces the number of recurrences of the illness.