What Is ERCP Surgery? Procedure, Risks & Recovery

ERCP, short for endoscopic retrograde cholangiopancreatography, is a procedure that combines a flexible camera (endoscope) with real-time X-ray imaging to diagnose and treat problems in the bile ducts and pancreatic ducts. It’s not technically surgery in the traditional sense, since there are no incisions on the outside of the body, but it does allow doctors to perform interventions like removing stones, opening narrowed ducts, and placing stents. Most people spend a few hours at the hospital and go home the same day.

What ERCP Actually Does

Your bile ducts and pancreatic ducts are small tubes that carry digestive fluids from the liver, gallbladder, and pancreas into the first part of the small intestine (the duodenum). When something blocks or narrows those ducts, bile or pancreatic juice can back up, causing pain, infection, jaundice, or pancreatitis. ERCP gives doctors a way to see and fix those problems in one session.

The doctor passes a thin, flexible scope through your mouth, down your esophagus, through your stomach, and into the duodenum. Once there, they locate the tiny opening where the bile and pancreatic ducts empty into the intestine. A catheter is threaded through the scope and into those ducts, and a contrast dye is injected so the ducts show up clearly on X-ray. The doctor watches this in real time using fluoroscopy, a type of continuous X-ray imaging, to spot blockages, stones, or narrowed areas.

When Doctors Recommend ERCP

ERCP is used when there’s a known or strongly suspected problem in the bile or pancreatic ducts that needs treatment, not just imaging. The most common reasons include:

  • Gallstones stuck in the bile duct. Gallstones can migrate out of the gallbladder and lodge in the common bile duct, causing pain, jaundice, or infection. ERCP can extract them.
  • Narrowed or blocked ducts. Scar tissue, inflammation, or tumors can squeeze these ducts shut. ERCP allows the doctor to widen (dilate) them or place a small tube called a stent to keep them open.
  • Leaking ducts. After gallbladder surgery or injury, bile can leak from a damaged duct. A stent placed during ERCP can help it heal.
  • Tissue sampling. If imaging shows a suspicious mass near the bile or pancreatic ducts, a biopsy can be taken during the procedure.

If your doctor only needs to look at the ducts without treating anything, they’ll typically order an MRCP instead. That’s a special type of MRI that produces images of the same ducts without any scope, sedation, or recovery time. MRCP carries no risk of complications but can’t treat what it finds. When a problem has already been confirmed and needs to be fixed, ERCP is the tool that can do both.

What Happens During the Procedure

You’ll be sedated, usually with deep sedation or general anesthesia, so you won’t feel anything during the procedure. You lie on your side or stomach while the scope is guided into position. Once the doctor identifies the duct opening in the duodenum, the real work begins.

For gallstone removal, the doctor often performs a sphincterotomy first. This means making a small cut in the muscular ring (sphincter) that controls the duct opening, which widens it enough to pull stones through. Stones are then captured with a tiny basket or balloon threaded through the scope. For duct blockages caused by tumors or scar tissue, the doctor may inflate a small balloon to stretch the narrowed area or slide a stent into place to hold it open.

The entire procedure typically takes 30 minutes to an hour, though complex cases can run longer. Stone clearance succeeds in roughly 70% to 93% of cases during the first attempt, depending on stone size and duct anatomy. About 23% of patients need a second procedure to finish clearing stones that couldn’t be removed on the first try.

How to Prepare

Preparation is straightforward but important. If you take blood-thinning medications, your doctor will typically ask you to stop them about two weeks before the procedure. You’ll need to stop eating solid food at midnight the night before, though clear liquids are usually fine until four hours before your scheduled time. At that point, nothing by mouth at all.

Because you’ll be sedated, you’ll need someone to drive you home afterward. Plan to take the rest of the day off.

Recovery After ERCP

After the procedure, you’ll spend one to two hours in a recovery area while the sedation wears off. Bloating and a mild sore throat are common and typically resolve within a day. Most people can eat a light meal within a few hours once they feel alert, though your doctor may give specific instructions depending on what was done during the procedure.

For straightforward cases like stone removal, most people return to normal activities within a day or two. If a stent was placed or the procedure was more involved, you may need a few extra days to feel fully recovered. Your doctor will let you know if any follow-up procedures or imaging are needed.

Risks and Complications

ERCP is generally safe, but it carries more risk than a standard upper endoscopy because instruments are being threaded into narrow ducts and, in many cases, tissue is being cut or stretched. A large systematic review found an overall complication rate of about 7%, with roughly one in four of those complications classified as severe.

The most common complication is post-ERCP pancreatitis, which occurs in about 3.5% of cases. This happens when the pancreatic duct becomes irritated during the procedure, triggering inflammation of the pancreas. It usually causes abdominal pain and nausea that develop within hours of the procedure, and most cases resolve with a short hospital stay for IV fluids and pain control. To reduce this risk, doctors often place a temporary small stent in the pancreatic duct after a sphincterotomy.

Other less common risks include bleeding from a sphincterotomy site (which usually stops on its own or can be treated during the procedure) and perforation, a small tear in the intestinal wall, which occurs in about 0.6% of cases and sometimes requires surgical repair. Infection is possible but uncommon, particularly when bile is unable to drain properly after the procedure.

By comparison, MRCP imaging carries essentially no procedural risks. No adverse events were reported across 28 studies comparing it to ERCP. This is a key reason doctors reserve ERCP for cases where treatment is actually needed rather than using it purely for diagnosis.