Peptic ulcer disease and its complications
Why the stomach usually doesn't digest itself, what tips it into making an ulcer, and how every test, treatment and complication follows from that one idea.

Case: a gnawing pain
A 58-year-old man has arthritis in both knees. For the last few months he’s been buying ibuprofen over the counter and taking it most days. He also takes sertraline for depression.
For six weeks he’s had a gnawing pain high in his abdomen, just under the breastbone. It often wakes him in the early hours of the morning, and a snack seems to settle it. His GP finds a low haemoglobin, and the iron studies show iron deficiency.
What’s going on, why did it happen, and what should happen next?

Anatomy: acid, and why the stomach survives it
The stomach runs from the fundus at the top, through the large body, to the antrum, which narrows to the pylorus: a ring of muscle that opens into the first part of the duodenum, the duodenal cap.
The lining of the body is full of parietal cells. Each one has a proton pump on its surface that pushes hydrogen ions into the stomach. That’s the acid. In the antrum, G cells release gastrin, which tells the parietal cells to make more acid, and D cells release somatostatin, the brake on gastrin.
So why doesn’t the stomach digest itself? Because the lining defends itself: a thick layer of mucus, with bicarbonate secreted into it so the surface stays near neutral, a good blood supply, and prostaglandins keeping all of that switched on.
One more bit of anatomy: the gastroduodenal artery runs just behind the first part of the duodenum.

Pathophysiology: attack against defence
The lining sits on a balance. On one side is attack: acid, and the protein-digesting enzyme pepsin. On the other is defence: mucus, bicarbonate, blood flow and prostaglandins. An ulcer forms when attack goes up or defence comes down.
A shallow break that stays within the mucosa is an erosion. An ulcer goes through the mucosa into the layers below, which is why ulcers can bleed and perforate: the deeper they go, the bigger the vessels they meet. “Peptic” comes from pepsin. In the stomach it’s a gastric ulcer; in the duodenum, a duodenal ulcer.
Helicobacter pylori
A spiral, Gram-negative bacterium that swims into the mucus with its flagella. It survives acid by making urease, which splits urea into ammonia and neutralises the acid around it. That urease is also how we test for it.
Where it lives decides what it does. In the antrum, it damages the D cells: less somatostatin, more gastrin, more acid, which spills into the duodenum and causes duodenal ulcers. Spread across the body, it causes atrophic gastritis: acid falls, but the lining weakens, so gastric ulcers form and the long-term risk of gastric cancer rises.
NSAIDs
NSAIDs, including aspirin, block cyclo-oxygenase (COX), which the stomach uses to make prostaglandins. Fewer prostaglandins means less mucus, less bicarbonate and less blood flow. Attack hasn’t changed, but defence has dropped. H. pylori and an NSAID together add their risks.
Other things that tip the balance: corticosteroids, SSRIs, bisphosphonates, potassium supplements, crack cocaine and smoking. SSRIs or steroids taken with an NSAID raise the chance of a bleeding ulcer.
Zollinger–Ellison syndrome
A rare cause that pushes attack to the maximum: a gastrinoma, usually in the duodenum or pancreas. The flood of gastrin drives huge amounts of acid, giving multiple, recurrent or oddly placed ulcers, and diarrhoea, because acid in the small bowel inactivates the enzymes that digest fat. It’s linked to MEN1.
In short: an ulcer is a hole through the mucosa, made when attack beats defence. H. pylori mostly raises attack, NSAIDs mostly lower defence, and a gastrinoma turns the acid up to maximum.

Signs: how an ulcer feels
Typically epigastric pain, burning or gnawing, often with nausea. With a duodenal ulcer the pain may ease with eating, as food buffers the acid, then return a few hours later or wake the patient at night. With a gastric ulcer it may get worse with eating. That pattern is a hint, not a diagnosis.
On examination there may be nothing more than epigastric tenderness. Some ulcers, especially NSAID ulcers, cause no pain at all, so the first sign may be a complication.
Listen for the clues. Pallor and tiredness from iron deficiency suggest slow bleeding. Melaena or vomiting blood means active bleeding. Persistent vomiting suggests the outlet is blocked. Weight loss should make you think of cancer.
Tests: the camera, and the bug
A peptic ulcer is diagnosed at endoscopy. Gastric ulcers are biopsied, because a cancer can look exactly like a benign ulcer. (Who needs an endoscopy, and how fast, is covered in the dyspepsia lesson.)
Test for H. pylori if the status isn’t known: a carbon-13 urea breath test or a stool antigen test. In the breath test the patient swallows labelled urea; if H. pylori is there, its urease splits it and the labelled carbon is breathed out as carbon dioxide. Anything that suppresses the bacterium can give a false negative, so the patient needs 2 weeks off PPIs and 4 weeks off antibiotics first.
A full blood count and ferritin pick up the iron deficiency of slow bleeding.
If Zollinger–Ellison is suspected, the first test is a fasting gastrin, read alongside the stomach’s acidity:
| Gastrin | Stomach | |
|---|---|---|
| Zollinger–Ellison | High | Very acidic (gastrin should be switched off, but isn’t) |
| No acid (atrophic gastritis) | High | pH high (an appropriate rise) |
PPIs raise gastrin too, and shouldn’t be stopped without specialist advice. When it’s still unclear, specialists may use a secretin test, in which gastrin paradoxically rises.
Options: remove the cause, hold the acid down
A proton pump inhibitor (omeprazole, lansoprazole) blocks the pump itself, the last step in making acid. An H2-receptor antagonist (famotidine) blocks one of the signals driving the pump, and is the option when a PPI isn’t working well enough.
| Situation | Treatment |
|---|---|
| NSAID-associated ulcer | Stop the NSAID if possible. Full-dose PPI or H2RA for 8 weeks, then eradication if H. pylori is present |
| No NSAID, H. pylori positive | Eradication: 7 days, twice daily, PPI + amoxicillin + clarithromycin or metronidazole (alternatives for penicillin allergy and second line are in the H. pylori lesson) |
| No NSAID, H. pylori negative | Full-dose PPI or H2RA for 4 to 8 weeks |
For everyone: stop smoking and review every medicine that could be harming the lining.
Follow-up. If H. pylori was treated, retest 6 to 8 weeks after starting treatment, with a urea breath test. A gastric ulcer gets a repeat endoscopy at 6 to 8 weeks, depending on its size, to check healing and exclude cancer.
An ulcer that won’t heal: check adherence, persistent or missed H. pylori, continued NSAID use (including over the counter), other ulcer-causing drugs and malignancy, then the rare causes: Zollinger–Ellison syndrome and Crohn’s disease.
If the NSAID must continue: discuss the risk, review the need at least every 6 months, use the lowest dose or switch to paracetamol if possible. After a previous ulcer, consider a COX-2 selective NSAID, and whichever NSAID is used, prescribe it with a PPI.
Nasties: going deeper
Bleeding, the commonest complication. An ulcer on the back wall of the duodenum can erode into the gastroduodenal artery. Haematemesis or coffee-ground vomit, melaena, shock. A slow ooze gives iron-deficiency anaemia instead. Acute upper GI bleeding is an emergency: resuscitate, risk-score and arrange urgent endoscopy.
Perforation. Sudden severe epigastric pain that spreads across the abdomen, which becomes rigid: peritonitis, sometimes collapse. CT is preferred when it can be done promptly; an erect chest X-ray may show free air under the diaphragm, but a normal X-ray doesn’t exclude it. Urgent surgical review, resuscitation with IV fluids and analgesia, nil by mouth, broad-spectrum IV antibiotics.
Gastric outlet obstruction. Ulcers near the pylorus heal with scar, which contracts and narrows the outlet: early fullness, vomiting of food eaten hours before, weight loss. Vomiting acid loses hydrogen and chloride, giving a hypochloraemic, hypokalaemic metabolic alkalosis.
And the quiet fourth: a gastric ulcer may itself be a cancer. That’s why it’s biopsied and always looked at again.
Exam traps: back to the patient
Our 58-year-old takes ibuprofen most days and sertraline, has night pain eased by food, and is iron deficient: most likely an NSAID-associated peptic ulcer, probably duodenal and slowly bleeding, with the sertraline adding to his bleeding risk. He needs an endoscopy. If it confirms an ulcer: stop the ibuprofen and offer paracetamol, give a full-dose PPI for 8 weeks, test for H. pylori and eradicate it afterwards if positive, then retest. Tell him to come back straight away with vomiting blood, black stools, collapse or sudden severe abdominal pain.
- Meal timing is a hint, not a diagnosis.
- A normal erect chest X-ray doesn’t exclude perforation. If the abdomen is peritonitic, get the surgeons and a CT.
- Breath test after a PPI. Two weeks off PPIs and four off antibiotics, or the result can be falsely negative.
- Gastric ulcers get a repeat endoscopy at 6 to 8 weeks. Duodenal ulcers don’t routinely need one.
- NSAID ulcer order: 8 weeks of acid suppression first, then eradication if H. pylori is present.
- Multiple or recurrent ulcers, unusual sites, or ulcers with diarrhoea: think Zollinger–Ellison, check a fasting gastrin, remember MEN1.
So: one balance, attack against defence. H. pylori turns the attack up, NSAIDs take the defence down, and the complications are the ulcer going deeper: into a vessel, through the wall, or scarring the exit.
High-yield summary
- An ulcer forms when attack (acid and pepsin) beats defence (mucus, bicarbonate, blood flow, prostaglandins). An ulcer goes deeper than the mucosa; an erosion doesn't.
- The two big causes are H. pylori (mostly raises acid) and NSAIDs, including aspirin (block COX, so fewer prostaglandins and weaker defence).
- Test for H. pylori with a carbon-13 urea breath test or stool antigen, after 2 weeks off PPIs and 4 weeks off antibiotics.
- NSAID ulcer: stop the NSAID, full-dose PPI or H2RA for 8 weeks, then eradicate H. pylori if present.
- H. pylori positive, no NSAID: eradication, 7 days of a PPI plus two antibiotics. Negative and no NSAID: PPI or H2RA for 4 to 8 weeks.
- Retest H. pylori 6 to 8 weeks after starting treatment, with a breath test. Gastric ulcers get a repeat endoscopy at 6 to 8 weeks to check healing and exclude cancer.
- Complications: bleeding (commonest; posterior duodenal ulcer into the gastroduodenal artery), perforation, gastric outlet obstruction.
- A normal erect chest X-ray doesn't exclude perforation. CT is preferred when it can be done promptly.
Try five of its cards
Press Space to see the answer, then Space again if you knew it, 2 if it was hard or 1 to see it again: the same keys as Anki. In the app, spaced repetition decides when each card comes back.
Sources this lesson was checked against
- NICE CG184: Gastro-oesophageal reflux disease and dyspepsia in adults (2014, updated 2019)
- NICE CKS: Dyspepsia – proven peptic ulcer (revised May 2024)
- WSES guidelines on perforated and bleeding peptic ulcer (World Journal of Emergency Surgery, 2020), international
- UK and Ireland Neuroendocrine Tumour Society guidance on neuroendocrine tumours (Gut)
Facts are checked against the primary source before anything is drawn. How we check facts.
Educational content for medical students preparing for exams. Not medical advice. Always follow current local and national guidance. The patients in this lesson are invented.
next lessonUpper GI bleeding: Glasgow-Blatchford to endoscopyGI-3.1 · Coming soon