The purpose of this study was to investigate the underlying mechanism(s) of the total alkaloids (TA) from Mahonia bealei in treating pyloric ligation-induced gastric ulcers in rats. Animals were sacrificed after 19h of the ligation. Gastric acid, peptic activities, mucin levels, H + /K + -ATPase activities and the gastrin level were analyzed. To improve the accuracy of the observations, IPP 6.0 software was introduced to measure the area of ulcer. TA (18.56mg/kg/day, i.g.) showed an antiulcer effect by significantly decreasing the gastric ulcer areas (11.28mm 2 ) compared with model group (26.36mm 2 ). The TA ulcer inhibition ratio was 57.2%, compared with the effect of the positive control, omeprazole (62.96%). The results also showed that TA had a significant effect in inhibiting the release of H + /K + -ATPase, reducing the content of gastrin and decreasing gastric acidity on experimental animals. However, the TA had no significant effects on gastric mucus secretion and pepsin activity. Data indicated that TA had gastric ulcer protective effects by modulating the H + /K + -ATPase activity and gastrin level. TA has a potential to be developed as a pharmacological agent for the treatment of gastric ulcers.