An endoscopic retrograde cholangiopancreatography (ERCP) is a procedure that lets a doctor diagnose and treat problems with your bile and pancreatic ducts.

The ERCP procedure uses a combination of X-rays and endoscopy. Endoscopy is when a long thin tube with special tools and a camera is inserted into your digestive tract.

A doctor may recommend ERCP if you have symptoms such as jaundice or unexplained abdominal pain, which may be an indication of a blockage, tumor, or other problem of your ducts.

Read on to learn more about when an ERCP may be needed, what to expect during the procedure, and potential risks.

ERCP is used to diagnose and treat problems with your bile or pancreatic ducts. ERCP has high rates of complications compared with other less invasive diagnostic tools such as magnetic resonance cholangiography or ultrasound.

Doctors generally recommend ERCP only when they suspect they’ll be able to treat the problem at the same time as it’s diagnosed.

Your bile and pancreatic ducts lead from your gall bladder and pancreas respectively to the upper part of your small intestines called your duodenum. The most common reason your doctor may recommend ERCP is if they suspect these ducts are blocked.

Conditions that can cause blockages in these ducts include:

An ERCP is performed by a gastroenterologist or general surgeon at a hospital, clinic, or doctor’s office. You’ll likely be told that you need to stop eating or drinking at least 6 hours before your procedure.

Before your surgery, your surgeon will talk with you about the risks and benefits. They may also give you medications to take the morning before your procedure and tell you to avoid taking medications such as blood thinners and immunosuppressants.

It’s important to follow your surgeons’ instructions carefully and to tell them if you’re allergic to shellfish or iodine.

General procedure

The procedure takes about 1 to 2 hours. Here’s an idea of what you can expect.

  1. An intravenous (IV) line is placed into your arm with sedatives to help you relax.
  2. You’ll be given a liquid anesthetic to gargle or as a spray for the back of your throat to prevent you from gagging. Some people are given general anesthesia to put them asleep.
  3. You’ll lie on the examination table and the surgeon will insert the endoscope into your throat and into your stomach and small intestines. Your surgeon will be able to see a video from the endoscope on a monitor. The endoscope will pump in air to make structures easier to see.
  4. Your doctor will locate where your bile and pancreatic ducts connect with your small intestines.
  5. They’ll insert a long flexible tube called a catheter through the endoscope into your ducts.
  6. A contrast dye will be inserted through the catheter to make the ducts more apparent appear on a type of X-ray called fluoroscopy.
  7. Your surgeon will pass tools through the endoscopy to treat specific problems such as the following.

Stone removal

ERCP is most commonly used to remove gallstones from your bile duct or stones from your pancreatic duct.


A sphincterotomy is a procedure where a muscular valve around the opening of your ducts is widened. Your sphincter of Oddi controls the flow of pancreatic juices and bile into your small intestines.

Stent placement

A stent is a device that’s implanted into your ducts to open a blocked passageway. Stents can also treat leaks in your ducts.

After your procedure

You’ll likely stay at the hospital or clinic for 1 or 2 hours after your procedure while the sedation and anesthetic wear off. Some people need to stay overnight.

Minor side effects such as bloating, nausea, and a sore throat are normal for a short time after your procedure. You can return to your normal diet when you can swallow normally.

You won’t be able to drive for 24 hours after your procedure, so it’s important to arrange a ride ahead of time.

ERCP is the method of choice for most cases of bile duct obstruction and many other bile duct conditions. Success rates vary based on the specific reason why ERCP is performed.

According to the authors of a 2020 study, ERCP has about a 90 percent success rate in children, which is similar to or slightly lower than in adults.

Complications occur in about 5 to 10 percent of ERCPs. Serious complications occur in 3 to 5 percent and as many as 15 percent of high-risk people.

Potential complications include:

  • pancreatitis
  • infections of your bile ducts or gallbladder
  • excessive bleeding
  • reaction to sedative
  • perforation of one of your ducts or small intestines
  • tissue damage from X-rays
  • death (rarely, in about 0.11 percent of cases)

When to seek medical help

It’s important to get emergency medical attention if you develop any of the following symptoms after your ERCP procedure:

Was this helpful?

ERCP is a procedure that’s used to treat and diagnose conditions that affect your bile or pancreatic ducts. It has higher rates of complications than other diagnostic tools, so doctors usually use it when they expect they’ll be able to treat the problem at the same time they diagnose it.

Your doctor can help you figure out if you may benefit from an ERCP. They can also talk with you about what to expect and the potential risks.