ERCP, short for endoscopic retrograde cholangiopancreatography, is a procedure that combines a flexible camera threaded down your throat with real-time X-ray imaging to find and fix problems in your bile ducts and pancreatic ducts. It’s one of the few procedures that can both diagnose and treat blockages in these ducts during the same session, which is why it has become the standard approach for conditions like bile duct stones.
How the Procedure Works
Your bile ducts carry bile from the liver to the small intestine, and your pancreatic ducts carry digestive enzymes from the pancreas to the same destination. Both duct systems empty into the duodenum, the first section of your small intestine. When stones, tumors, or scar tissue block these ducts, bile and digestive enzymes back up, causing pain, jaundice, and potentially serious infections.
During ERCP, a specialist passes a thin, flexible scope (called a duodenoscope) through your mouth, down your esophagus, through your stomach, and into the duodenum. This scope has a side-viewing camera that lets the doctor locate the tiny opening where the bile and pancreatic ducts empty into the intestine. A catheter is then threaded through the scope and into the ducts. The doctor injects a contrast dye through the catheter, which makes the duct system visible on X-ray. Using continuous X-ray imaging (fluoroscopy), the doctor can see the entire duct network in real time and spot narrowed areas, stones, or blockages.
What ERCP Can Treat
ERCP started as a diagnostic tool, but today it’s used far more often for treatment. Once the doctor can see the problem on fluoroscopy, several interventions are possible through the same scope:
- Stone removal: Stones trapped in the bile duct can be pulled out using small baskets or balloons passed through the scope.
- Sphincterotomy: A small cut is made at the opening of the duct to widen it, making it easier to extract stones or improve drainage.
- Stent placement: Plastic or metal tubes can be placed inside a narrowed duct to hold it open and restore the flow of bile or pancreatic fluid.
- Stricture dilation: Narrowed sections of duct caused by scarring or tumors can be stretched open with a balloon.
Why Your Doctor Might Recommend It
The most common reason for ERCP is bile duct stones. These are gallstones that have migrated out of the gallbladder and lodged in the common bile duct, blocking the flow of bile. When that happens, you typically feel colicky pain in the upper right side of your abdomen. Your skin and eyes may turn yellow (jaundice), your urine may darken to a tea color, and your stools may become pale or clay-colored. Itching, nausea, and vomiting are also common.
If a bile duct stone isn’t removed, stagnant bile can become infected, leading to a condition called ascending cholangitis. This causes fever, chills, and in severe cases, confusion or altered mental status. Because the pancreatic duct often shares an opening with the bile duct, a stone lodged in that area can also block pancreatic enzymes and trigger gallstone pancreatitis, which causes continuous pain in the middle of the abdomen that radiates to the back.
Beyond stones, ERCP is also used to evaluate and treat bile duct narrowing caused by tumors (such as pancreatic or bile duct cancer), to place stents that relieve obstruction in patients who aren’t candidates for surgery, and to manage leaks or injuries to the bile ducts after gallbladder removal.
How ERCP Compares to Non-Invasive Imaging
If your doctor only needs to look at the ducts without treating anything, a non-invasive alternative called MRCP (magnetic resonance cholangiopancreatography) can produce detailed images using an MRI scanner. In a head-to-head comparison published in Gastrointestinal Endoscopy, MRCP matched ERCP closely for detecting cancerous bile duct strictures, with 85% sensitivity for both. CT scans and endoscopic ultrasound performed slightly lower, at 77% and 79% sensitivity respectively.
The key difference is that MRCP can only diagnose. If imaging reveals a stone or blockage that needs treatment, you’ll still need ERCP. For this reason, doctors often use MRCP first when the diagnosis is uncertain, reserving ERCP for cases where treatment is likely needed.
Preparing for the Procedure
You’ll need to fast for at least eight hours before ERCP, and most facilities ask you not to eat or drink anything after midnight the night before. If you take blood thinners or diabetes medications, your doctor will give you specific instructions on whether to adjust or pause them. You’ll receive sedation or general anesthesia for the procedure, so you won’t be awake or in pain during it. Plan to have someone available to drive you home afterward.
Who Performs ERCP
ERCP requires specialized training beyond what a standard gastroenterologist receives. In the United States, doctors who perform ERCP typically complete a three-year gastroenterology fellowship followed by at least one additional year of advanced endoscopy training. This extra fellowship focuses specifically on complex procedures like ERCP and endoscopic ultrasound. After training, each hospital’s credentialing committee independently grants the doctor permission to perform the procedure at that facility.
Risks and Complications
The most well-known complication is post-ERCP pancreatitis, which is inflammation of the pancreas triggered by the procedure. This occurs in roughly 2% to 16% of patients, depending on risk factors. Most cases are mild and resolve within a few days with fasting and IV fluids, but it’s the main reason you’re monitored after the procedure before being sent home.
More serious but rarer complications include perforation (a small tear in the intestinal wall), which occurs in about 0.2% to 0.3% of cases. When perforation does happen, it carries significant risk, though most patients recover with conservative treatment such as fasting, antibiotics, and close monitoring. Bleeding can occur after sphincterotomy but is also uncommon and usually manageable during the procedure itself.
Recovery and What to Expect After
After the procedure, you’ll be observed for a period that typically lasts around two hours but can extend to six hours or longer if your doctor wants to watch for signs of pancreatitis or other complications. During this time, staff will monitor you for abdominal pain, fever, or other warning signs. Blood tests to check pancreatic enzyme levels are commonly done at three hours and again later.
For most patients, same-day discharge is safe, even after interventions like stone removal or stent placement. Before you leave, you should receive written instructions covering what to eat, activity restrictions, medications, and follow-up appointments. A responsible person needs to accompany you home because the sedation takes time to fully wear off. Most people can return to normal activities within a day or two, though you may have mild throat soreness or bloating from the air introduced during the procedure.

