Disclosed are carbostyril derivatives and their salts of the formulas ##STR1## The compounds have anti-peptic ulcer effects, and are useful as a treating agent for curing peptic ulcers in the digestive system, such as ulcers in the stomach and in the duodenum. The compounds particularly have prophylaxis and curing effects for treating chronic ulcers, for example experimental acetic acid-induced ulcers and cautery ulcers, with both low toxicity and few side-effects. Also disclosed are processes for preparing the compounds and for preparing pharmaceutical compositions containing them.