H. pylori and peptic ulcer disease: how mucosal defence fails
More than a third of people worldwide carry H. pylori, yet only a minority develop an ulcer. This lesson builds the balance between acid and mucosal defence, then shows how H. pylori and NSAIDs break it.
Chapters (10)
Explain how H. pylori and NSAIDs disrupt mucosal defence to cause gastric and duodenal ulcers.
The short version
- Ulcers appear when mucosal defence fails, and H. pylori and NSAIDs are the two main causes.
- Antral H. pylori means more acid and a duodenal or prepyloric ulcer; body H. pylori means less acid and a gastric ulcer.
- NSAIDs block COX-1, and prostaglandins are the lining's own defence.
- A duodenal ulcer is rarely malignant, while the edge of a gastric ulcer is biopsied to exclude cancer.
- Bleeding is the most common complication of an ulcer, and perforation causes peritonitis.
H. pylori and peptic ulcer disease: why only some stomachs break down
More than a third of people worldwide carry Helicobacter pylori.[8] Yet only a minority of them ever develop an ulcer.
This lesson on H. pylori and peptic ulcer disease answers the obvious question: same bug, so why do some stomachs break down and others never do? The answer starts with the balance between attack and defence in the stomach lining.
The lesson follows that order: first the balance itself, then H. pylori and where it settles, then NSAIDs, then the way the two kinds of ulcer present, and finally the complications and the treatment.
Mucosal defence versus acid and pepsin
Think of the lining as a balance. Acid and pepsin attack, and defences hold them off.[4][3]
- Bicarbonate-rich mucus
- Tight junctions between epithelial cells
- Mucosal blood flow
- Prostaglandins
- Fast repair, with the surface replaced every 3–6 days
An erosion is superficial. An ulcer breaks through the muscularis mucosae.[2][5]
So an ulcer is not simply too much acid. Even when acid rises, an ulcer forms only where the defences on the surface are weakened and acid and pepsin win the balance.
Between them, H. pylori and NSAIDs cause most ulcers, and both work by weakening defence.[4][2]
H. pylori, urease and the urease-based tests
H. pylori is a spiral, Gram-negative rod that thrives in acid. Its trick is urease, which turns urea into ammonia, a local buffer that may also erode the mucus.[1][7]
That urease is what we test for. The urea breath test detects labelled carbon dioxide, and a biopsy changes colour in the rapid urease test.[1]
Antrum versus body: duodenal ulcer, gastric ulcer and cancer risk
Where the bacterium settles decides the kind of ulcer.[1][6]
| Site | Effect on acid | Ulcer and risk |
|---|---|---|
| Mainly the antrum | Somatostatin release is impaired, so gastrin and acid output rise | Excess acid floods the duodenum: prepyloric or duodenal ulcer |
| Mainly the body | The lining atrophies and acid falls | Predisposes to gastric ulcer and to gastric adenocarcinoma |
H. pylori is a group 1 carcinogen.[8][1]
- Find where the bacterium settlesAntrum or body: that decides the kind of ulcer.
- Follow the acidAntral infection impairs somatostatin release, so gastrin and acid output rise. Body infection atrophies the lining, so acid falls.
- Name the ulcerMore acid floods the duodenum and gives a prepyloric or duodenal ulcer. Less acid with atrophy predisposes to gastric ulcer and to gastric adenocarcinoma.
NSAIDs: COX-1, prostaglandins and ion trapping
NSAIDs block cyclooxygenase, and the gastric prostaglandins depend on COX-1. Less prostaglandin means less mucus and bicarbonate, less blood flow, and slower repair.[3][5]
The drugs are also weak acids, so they slip into epithelial cells and release protons inside them.[3]
Selective COX-2 inhibitors spare COX-1, so they cause fewer gastric ulcers.[3]
Two patients: pain patterns and the biopsy rule
| Pain pattern | Suggests | Biopsy | |
|---|---|---|---|
| First patient | Eases with food, returns a few hours after a meal, sometimes wakes him at night | Classic duodenal pattern | A duodenal ulcer is rarely malignant, so biopsy is seldom needed |
| Second patient | May even worsen with eating | Gastric ulcer | The edge is biopsied to exclude cancer |
The first patient has pain that eases with food, returns a few hours after a meal and sometimes wakes him at night. That is the classic duodenal pattern.[2]
The second patient has pain that may even worsen with eating. That suggests a gastric ulcer, and its edge is biopsied to exclude cancer.[2]
Complications and treatment
In both kinds of ulcer, bleeding is the most common complication, and perforation causes peritonitis.[2][4]
Treatment follows the cause: eradicate H. pylori with acid suppression and antibiotics, and stop the NSAID.[2][4]
A rarer cause is a gastrin-secreting tumour (gastrinoma). It suggests multiple ulcers, ulcers in unusual places or ulcers that do not respond to treatment.[2][9]
Practice question
Original · USMLE styleA 61-year-old woman has had 3 months of epigastric pain, often worse after meals, with early satiety and a 4-kg weight loss. Endoscopy shows a 2-cm ulcer on the lesser curvature of the stomach, and biopsies of the ulcer edge show no malignancy. Biopsies of the gastric body show chronic gastritis with glandular atrophy and curved Gram-negative bacilli.
Common questions
How do H. pylori and NSAIDs cause peptic ulcers?
Both weaken mucosal defence, so acid and pepsin can break through the lining. H. pylori does it through urease-made ammonia, which may erode the mucus, and by changing acid output according to where it settles; NSAIDs do it by blocking COX-1 and the prostaglandins that the lining depends on.
Why does H. pylori cause a duodenal ulcer in some people and a gastric ulcer in others?
It depends on where the bacterium settles. Mainly in the antrum, gastrin and acid output rise and the excess acid floods the duodenum. Mainly in the body, the lining atrophies and acid falls, which predisposes to gastric ulcer.
What is the role of urease in H. pylori?
Urease turns urea into ammonia, a local buffer that may also erode the mucus. It is also what the urea breath test and the rapid urease test detect.
Why are gastric ulcers biopsied but duodenal ulcers seldom are?
A duodenal ulcer is rarely malignant, so biopsy is seldom needed. The edge of a gastric ulcer is biopsied to exclude cancer.
Why do selective COX-2 inhibitors cause fewer gastric ulcers?
Gastric prostaglandins depend on COX-1, and selective COX-2 inhibitors spare COX-1.
Transcript
Read the full narration, by chapter651 words
0:00Same bug, so why do only some stomachs break down?
More than a third of people worldwide carry Helicobacter pylori. Yet only a minority of them ever develop an ulcer. Same bug, so why do some stomachs break down and others never do? Today: explain how H. pylori and NSAIDs break mucosal defence to cause gastric and duodenal ulcers.
0:21Mucosal defence versus acid and pepsin; erosion versus ulcer
Think of the lining as a balance: acid and pepsin attack, and defences hold them off. The defences are bicarbonate-rich mucus, tight junctions, mucosal blood flow, prostaglandins and fast repair, with the surface replaced every three to six days. An erosion is superficial, but an ulcer breaks through the muscularis mucosae. Between them, H. pylori and NSAIDs cause most ulcers, and both work by weakening defence.
0:51H. pylori, urease and the urease-based tests
H. pylori is a spiral, Gram-negative rod that thrives in acid. Its trick is urease, which turns urea into ammonia, a local buffer that may also erode the mucus. That urease is what we test for: the urea breath test detects labelled carbon dioxide, and a biopsy changes colour in the rapid urease test.
1:14Antrum versus body: duodenal ulcer, gastric ulcer, cancer risk
Where the bacterium settles decides the kind of ulcer. If it settles mainly in the antrum, somatostatin release is impaired, so gastrin and acid output rise. That excess acid floods the duodenum, and the result is a prepyloric or duodenal ulcer. If it settles mainly in the body, the lining atrophies and acid falls. That pattern predisposes to gastric ulcer and to gastric adenocarcinoma, and H. pylori is a group one carcinogen.
1:46NSAIDs: COX-1, prostaglandins and ion trapping
Now NSAIDs. They block cyclooxygenase, and the gastric prostaglandins depend on COX-1. Less prostaglandin means less mucus and bicarbonate, less blood flow, and slower repair. The drugs are also weak acids, so they slip into epithelial cells and release protons inside them. Selective COX-2 inhibitors spare COX-1, so they cause fewer gastric ulcers.
2:15Two patients: pain patterns and the biopsy rule
Compare two patients. The first has pain that eases with food, returns a few hours after a meal, and sometimes wakes him at night. That is the classic duodenal pattern, and a duodenal ulcer is rarely malignant, so biopsy is seldom needed. The second has pain that may even worsen with eating. That suggests a gastric ulcer, and its edge is biopsied to exclude cancer.
2:42Complications and treatment
In both, bleeding is the most common complication, and perforation causes peritonitis. Treatment follows the cause: eradicate H. pylori with acid suppression and antibiotics, and stop the NSAID.
2:57Practice question
Your turn. A 61-year-old woman has had three months of epigastric pain, often worse after meals, with early satiety and a four-kilogram weight loss. Endoscopy shows a two-centimetre ulcer on the lesser curvature, and biopsies of the ulcer edge show no malignancy. Biopsies of the gastric body show chronic gastritis with glandular atrophy and curved Gram-negative bacilli. Which of the following best describes the underlying gastric physiology? A, antral atrophy with low gastrin. B, antral-predominant gastritis with high acid output. C, autoimmune gastritis with absent intrinsic factor. D, body-predominant gastritis with low acid output. E, a gastrin-secreting tumour with high acid output. Pause here and decide.
3:55The answer, one option at a time
A is out: the biopsies show atrophy in the body, not the antrum, and low gastrin would not explain an ulcer. B is out: antral-predominant infection gives high acid and duodenal or prepyloric ulcers. C is out: autoimmune gastritis also lowers acid, but the curved Gram-negative bacilli point to H. pylori as the cause here. E is out: a gastrinoma suggests multiple or unusual ulcers, and this is a single gastric ulcer with the bacterium present. So the answer is D. Body-predominant infection causes atrophy and low acid, and it predisposes to gastric ulcer and gastric cancer.
4:40Recap and the next lesson
Three things to keep. One: ulcers appear when defence fails, and H. pylori and NSAIDs are the two main causes. Two: antral H. pylori means more acid and a duodenal ulcer, and body H. pylori means less acid and a gastric ulcer. Three: NSAIDs block COX-1, and prostaglandins are the lining's own defence. Next, bilirubin metabolism and the types of jaundice.
Sources
Numbers in the text, e.g. [1], point here- MSD Manual Professional Version. Helicobacter pylori Infection. msdmanuals.com/professional/gastrointestinal-disorders/gastritis-and-peptic-ulcer-disease/helicobacter-pylori-infection
- MSD Manual Professional Version. Peptic Ulcer Disease. msdmanuals.com/professional/gastrointestinal-disorders/gastritis-and-peptic-ulcer-disease/peptic-ulcer-disease
- MSD Manual Professional Version. Overview of Acid Secretion. msdmanuals.com/professional/gastrointestinal-disorders/gastritis-and-peptic-ulcer-disease/overview-of-acid-secretion
- OpenStax. Anatomy and Physiology 2e, 23.4 The Stomach. openstax.org/books/anatomy-and-physiology-2e/pages/23-4-the-stomach
- Review of Peptic Ulcer Disease (2026). Europe PMC PMC13356852. europepmc.org/article/MED/PMC13356852
- The Role of Somatostatin in the GI Tract (2025). Europe PMC PMC12109247. europepmc.org/article/MED/PMC12109247
- In Pursuit of the Parietal Cell (2019). Europe PMC PMC6920182. europepmc.org/article/MED/PMC6920182
- H. pylori prevalence review (2026). Europe PMC PMC13079146. europepmc.org/article/MED/PMC13079146
- Gastrinoma (functioning pancreatic neuroendocrine tumour) review. Europe PMC PMC13695398. europepmc.org/article/MED/PMC13695398
Prevalence and ulcer rates vary by population. The schematic drawings are teaching models, not to scale.
The practice question is original and its patient is synthetic. Every fact is checked against the sources above in independent accuracy reviews. Always follow your local guidelines and your own laboratory’s ranges.
Image credits. Illustrations: Servier Medical Art (smart.servier.com), CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), adapted (cropped, recoloured, outlined, one mirrored): stomach in section, duodenum, gastric gland, bread. The people grid, balance, wall sections, H. pylori rod, urease reaction, test sketches, ulcer craters, pain curves, question card, pocket card and all handwriting are drawn in code (original). No AI-generated teaching images.
Corrections. None so far. Spotted an error? Email info@medservatory.com with the lesson code MS-S1-GI-008.
For exam study only, not medical advice. Read the medical disclaimer.