Stomach ulcers cause burning or gnawing stomach pain in the upper or middle stomach, according to WebMD. The pain may feel like hunger and may extend to the back.
Pain due to stomach ulcers lasts anywhere from a few minutes to a few hours and often goes away when the patient takes acid reducer medication, explains WebMD. The pain may come and go for weeks, alternating with pain-free periods.
If the ulcers are in the upper small intestines, the pain is more intense when the patient is hungry and in the middle of the night, notes WebMD. Pain from gastric ulcers in the stomach occurs shortly after the patient eats, while food is still in his stomach.