Gastroenterology & Hepatobiliary

ERCP

ERCP (endoscopic retrograde cholangiopancreatography) is a specialised endoscopic procedure used to examine and treat problems in the bile ducts and pancreatic duct. It can remove stones, relieve blockages, place stents, and take tissue samples in a single session, often avoiding the need for open surgery.

Read Full Article ↓
ERCP

Introduction

If your doctor has recommended an ERCP, you are likely dealing with a problem in your bile ducts or pancreas — perhaps a gallstone stuck in a duct, a narrowing that is blocking bile flow, jaundice that needs to be investigated and treated, or a complication after gallbladder surgery. ERCP is one of the main procedures doctors use to look inside these ducts and, in most cases, to treat what they find during the same session.

This guide is written for patients who already know an ERCP is being planned or considered. It explains what the procedure is, why doctors use it, what happens before, during, and after, what risks to be aware of, and what alternatives may exist. The aim is to help you arrive at your appointment with a clearer picture of what to expect and better questions to ask your team.

What Is ERCP?

ERCP stands for endoscopic retrograde cholangiopancreatography. The name describes what it does: it uses an endoscope (a flexible tube with a camera) and X-ray imaging to look at the bile ducts and pancreatic duct, working “backwards” (retrograde) up these ducts from where they empty into the small intestine.

During an ERCP, an endoscopist passes a specialised endoscope called a duodenoscope through your mouth, down the food pipe (oesophagus), through the stomach, and into the first part of the small intestine (the duodenum). There, the doctor locates a small opening called the ampulla of Vater, where the bile duct and pancreatic duct drain into the bowel. A thin tube (catheter) is passed through this opening, and a contrast dye is injected so the ducts show up on X-ray pictures taken during the procedure.

Anatomical diagram of liver, gallbladder, bile duct, pancreas, pancreatic duct, ampulla of Vater, and duodenum.
Anatomy of the biliary and pancreatic duct system showing: ① liver, ② gallbladder, ③ common bile duct, ④ pancreas, ⑤ pancreatic duct, ⑥ ampulla of Vater, ⑦ duodenum.
*AI-generated image - for illustration only. Clinical accuracy is not guaranteed.

Two features make ERCP unusual among endoscopic tests:

  • It combines endoscopy with live X-ray imaging (fluoroscopy), giving doctors a real-time view of ducts that other scopes cannot reach.
  • It is both diagnostic and therapeutic — meaning the doctor can not only find a problem but also treat it in the same session, using small instruments passed through the scope.

Because of this dual nature, ERCP is rarely used today purely to look at the ducts. Less invasive imaging tests have replaced its purely diagnostic role. ERCP is now mostly used when doctors already strongly suspect a problem that will need treating during the same procedure.

Types of ERCP

ERCP is usually grouped by what the doctor sets out to do during the session. The same equipment and basic technique are used; what differs is the purpose and the instruments brought to bear.

Diagnostic ERCP

In a purely diagnostic ERCP, the goal is to obtain images of the bile ducts and pancreatic duct after injecting contrast dye, and sometimes to collect samples for testing (cells brushed from the duct wall, or small tissue biopsies).

Today, purely diagnostic ERCP is uncommon. Magnetic resonance cholangiopancreatography (MRCP), endoscopic ultrasound (EUS), and CT scans can show the ducts without the risks of an invasive procedure. Major society guidance, including from the American Society for Gastrointestinal Endoscopy (ASGE), generally recommends that ERCP be reserved for situations where therapy is likely to be needed, rather than as a stand-alone diagnostic test.

Therapeutic ERCP

Therapeutic ERCP — where the doctor treats a problem during the same session — accounts for the great majority of procedures performed today. Common therapeutic actions include:

  • Sphincterotomy — making a small cut at the opening of the bile or pancreatic duct to widen it, using a heated wire passed through the scope.
  • Stone removal — using small baskets or balloons to capture and pull out stones that have lodged in the bile duct.
  • Stent placement — inserting a small plastic or metal tube into a narrowed or blocked duct to keep it open so bile or pancreatic juice can drain.
  • Dilation — gently stretching narrowed sections of duct with a balloon.
  • Drainage of infected bile — relieving pressure and infection in the bile system (cholangitis).
  • Tissue sampling — brushing cells or taking biopsies when a tumour is suspected.

Why Is ERCP Performed?

ERCP is used when there is good evidence of a treatable problem in the bile ducts, gallbladder drainage system, or pancreatic duct. The most common reasons doctors recommend ERCP include the following.

Bile Duct Stones (Choledocholithiasis)

Gallstones can travel out of the gallbladder and become stuck in the bile duct, blocking the flow of bile from the liver. This causes jaundice, pain, and sometimes infection. ERCP allows the stones to be removed without open or keyhole abdominal surgery.

Blocked Bile Flow and Jaundice

When bile cannot drain, bilirubin builds up in the blood and the skin and eyes turn yellow (jaundice). The blockage may be from stones, narrowing (stricture), or a tumour. ERCP can identify the cause and, in most cases, place a stent to restore drainage.

Bile Duct Strictures

Strictures are narrowed sections of duct. They can be benign (for example, after gallbladder surgery, chronic inflammation, or primary sclerosing cholangitis) or malignant (caused by tumours of the bile duct, pancreas, or nearby structures). ERCP can be used to take tissue samples to determine the cause and to widen the stricture or place a stent.

Bile Duct Injuries and Leaks

Sometimes the bile duct is damaged during gallbladder removal or other upper abdominal surgery, leading to a leak of bile into the abdomen. ERCP can identify the leak and place a stent that diverts bile away from the leak site so it can heal.

Pancreatic Duct Problems

ERCP is used selectively for problems in the pancreatic duct, including duct stones, narrowing, leaks after pancreatic injury or surgery, and certain cases of chronic pancreatitis where the duct is blocked or disrupted.

Suspected Tumours of the Bile Duct or Ampulla

When imaging suggests a tumour at the junction of the bile duct and intestine (the ampulla) or within the bile duct itself, ERCP allows direct visualisation, tissue sampling, and stent placement to relieve jaundice while further treatment is planned.

Acute Gallstone Pancreatitis with Cholangitis or Persistent Obstruction

In gallstone pancreatitis, ERCP is generally reserved for patients who also have infection of the bile ducts (cholangitis) or whose bile duct remains blocked. It is not routinely used for uncomplicated gallstone pancreatitis. Current guidance from major societies, including the American College of Gastroenterology, supports this selective approach.

Preparation for ERCP

Good preparation reduces complications and makes the procedure smoother. Your team will give you instructions specific to your situation; the points below describe what is generally involved.

Tests Before ERCP

Before recommending ERCP, doctors usually want to confirm that there is a treatable duct problem. Tests commonly performed beforehand include:

  • Blood tests — liver function tests, bilirubin, amylase or lipase (pancreatic enzymes), full blood count, and clotting tests.
  • Abdominal ultrasound — often the first imaging test, useful for showing gallstones and dilated bile ducts.
  • MRCP (magnetic resonance cholangiopancreatography) — a non-invasive MRI scan that produces detailed pictures of the bile and pancreatic ducts without any instrument entering the body.
  • Endoscopic ultrasound (EUS) — an ultrasound probe on the tip of an endoscope, used to look closely at the ducts and nearby tissues; particularly useful when the diagnosis is uncertain.
  • CT scan — sometimes used when tumour or complicated anatomy is suspected.

Because ERCP carries real risks, modern practice is to use these non-invasive tests first so that ERCP is only undertaken when therapy is likely to be needed.

Medication Review

Tell your team about every medication you take, including over-the-counter and herbal products. Of particular importance are:

  • Blood thinners and antiplatelet drugs (for example, warfarin, apixaban, clopidogrel, dual antiplatelet therapy after a stent). Many of these may need to be stopped or adjusted before ERCP, especially if a sphincterotomy is planned.
  • Diabetes medications, including insulin — doses are usually adjusted because of fasting.
  • Allergies, especially to contrast dye, latex, or specific medications.

Fasting

You will be asked not to eat for several hours before the procedure (commonly 6–8 hours for solid food and 2–4 hours for clear fluids, although exact timings vary). An empty stomach reduces the risk of inhaling stomach contents during sedation.

Consent and Discussion

You will be asked to give written consent. This is the right time to ask:

  • What is the specific aim of the ERCP in my case?
  • What are the chances it will resolve the problem in one session?
  • What are my personal risks based on age, anatomy, and medications?
  • What happens if the procedure does not work or cannot be completed?
  • Will a stent be left in, and if so, will I need a further procedure to remove or replace it?

What Happens During ERCP

An ERCP usually takes between 30 and 90 minutes, depending on what needs to be done. Complex therapeutic cases can take longer.

Sedation and Positioning

ERCP is almost always performed under sedation. Depending on the setting and the case, this may be deep sedation given by an anaesthetist, or general anaesthesia. You should not feel pain during the procedure and most people remember little or nothing of it afterwards.

You will usually be positioned on your left side or on your front (prone) on the X-ray table. A mouthguard protects your teeth and the scope. A local anaesthetic spray may be used at the back of the throat.

Passing the Scope

Four-panel procedural diagram of ERCP showing scope insertion, positioning in duodenum, catheter cannulation of bile duct, and fluoroscopic contrast imaging.
Four-stage ERCP procedure: ① duodenoscope passed through the mouth and oesophagus, ② scope tip positioned in the duodenum facing the ampulla, ③ catheter threaded through the ampulla into the bile duct, ④ contrast dye injected with live X-ray imaging showing the duct.
*AI-generated image - for illustration only. Clinical accuracy is not guaranteed.

Cannulating the Duct and Imaging

A thin catheter (or a wire) is passed through the scope and threaded into the bile duct, the pancreatic duct, or both, through the ampulla. Contrast dye is injected, and X-ray pictures are taken in real time. These pictures show the shape of the ducts and any stones, narrowings, leaks, or filling defects.

Therapeutic Steps

Once the problem is identified, the doctor proceeds with treatment as needed:

  • A small cut may be made at the duct opening (sphincterotomy) to provide access.
  • Stones may be pulled out using a basket or balloon.
  • A narrowing may be widened with a balloon dilator.
  • A stent may be placed to keep a duct open and allow drainage.
  • Brush cytology or biopsy may be taken if a tumour is suspected.

When the work is complete, the scope is gently withdrawn. The whole procedure happens with you lying still and breathing on your own (under deep sedation) or with the anaesthetist managing your breathing (under general anaesthesia).

Recovery and Aftercare

ERCP is usually performed as a same-day or short-stay procedure, although some patients are kept in hospital overnight for observation, especially if therapy was complex or if there are risk factors for complications.

Immediately After the Procedure

Five-stage illustrated recovery timeline after ERCP procedure from waking in recovery through return to normal activities.
ERCP recovery timeline: ① waking in recovery room, ② sips of water and observation, ③ discharge home with companion, ④ light activities resumed at 1–2 days, ⑤ full normal activity by several days post-procedure.
*AI-generated image - for illustration only. Clinical accuracy is not guaranteed.
  • Drowsiness and grogginess.
  • A sore throat from the scope.
  • Mild bloating from air introduced during the procedure.
  • Mild discomfort in the upper abdomen.

Your team will check your blood pressure, pulse, and oxygen levels and look for signs of complications. Blood tests, including pancreatic enzymes, may be taken a few hours after the procedure if you are being observed in hospital.

Eating and Drinking

Most people start with sips of water once they are fully awake, then move to light food a few hours later if everything is going well. If you have had complex therapy or pancreatic duct manipulation, your team may keep you on a clear liquid diet for longer.

Going Home

If you go home the same day, you will need someone to take you home and stay with you overnight. Sedation affects judgement and reaction time for the rest of the day, so you should not drive, operate machinery, sign important documents, or drink alcohol for at least 24 hours.

Most people return to normal activities within 1–2 days, although you may feel tired for a few days. Recovery is faster than after open or keyhole abdominal surgery.

Symptoms to Report

Contact your hospital or seek urgent care if, after going home, you develop:

  • Severe or worsening abdominal pain, especially in the upper abdomen or back.
  • Persistent vomiting.
  • Fever or chills.
  • Black, tarry stools or vomiting blood.
  • Worsening yellowing of skin or eyes.
  • Difficulty breathing or chest pain.

These can be early signs of complications such as pancreatitis, infection, bleeding, or perforation, and need prompt assessment.

Understanding the Results

Your endoscopist will usually speak to you (and a family member, if you wish) shortly after the procedure to explain what was found and done. Because you are likely to be drowsy, written information or a follow-up conversation is often provided as well.

Typical pieces of information from an ERCP report include:

  • Whether the ducts were successfully entered and imaged.
  • What the X-ray pictures showed — stones, narrowings, leaks, tumours, or normal anatomy.
  • What therapy was performed (sphincterotomy, stone removal, stent placement, dilation, biopsy).
  • Whether anything was left in place (such as a stent) and when it will need to be reviewed.
  • Results of any tissue samples — these usually take a few days to come back from the laboratory.

If a stent has been placed, it is important to understand:

  • Whether it is plastic or metal.
  • Whether it is intended to be temporary or long-term.
  • When the next ERCP is planned to remove or change it (plastic stents typically need to be exchanged within a few months to prevent blockage and infection).

Risks and Complications

ERCP is one of the more complex endoscopic procedures, and it carries a higher risk of complications than routine upper endoscopy or colonoscopy. For most patients with a clear indication, the risk of leaving a duct problem untreated is greater than the risk of the procedure itself, but it is important to understand what can happen.

Post-ERCP Pancreatitis

Side-by-side anatomical comparison of a healthy pancreas and an inflamed swollen pancreas showing post-ERCP pancreatitis changes.
Comparison of a normal pancreas and an inflamed pancreas: ① healthy pancreas with regular borders and clear duct, ② inflamed pancreas showing swelling, oedema, and widened surrounding tissue characteristic of pancreatitis.
*AI-generated image - for illustration only. Clinical accuracy is not guaranteed.

Symptoms appear within hours of the procedure and include upper abdominal pain (often radiating to the back), nausea, and vomiting. Most cases are mild and settle with fluids, pain control, and a short hospital stay. Severe pancreatitis is less common but can be serious.

To reduce this risk, doctors increasingly use measures supported by ESGE and ASGE guidance, including rectal non-steroidal anti-inflammatory drugs (such as indomethacin or diclofenac) given around the time of the procedure, careful technique, and selective use of a small temporary pancreatic duct stent in higher-risk cases.

Bleeding

Bleeding can occur, particularly after a sphincterotomy. Most bleeds are minor and stop on their own or are controlled during the procedure. Significant bleeding occurs in roughly 1–2 of every 100 therapeutic ERCPs. Risk is higher in patients on blood thinners or with clotting problems.

Infection (Cholangitis)

If bile drainage is not fully restored, bacteria can build up in the bile ducts and cause infection (cholangitis), with fever, chills, abdominal pain, and worsening jaundice. Antibiotics may be given before and after the procedure when this risk is higher.

Perforation

A tear in the wall of the duodenum or duct is uncommon (less than 1 in 100 procedures) but is potentially serious. It may need to be managed with antibiotics, endoscopic closure, or surgery depending on size and location.

Reactions to Sedation or Contrast

Reactions to sedative medications or the contrast dye are uncommon. Your team will ask about previous reactions before the procedure.

Stent-Related Issues

Stents can become blocked, dislodged, or migrate. Plastic stents in particular need to be exchanged within a few months. Your team will plan follow-up to manage this.

Failure to Complete the Procedure

Occasionally, the doctor is unable to enter the intended duct because of difficult anatomy, previous surgery, or other reasons. A second attempt by a different endoscopist, a different procedure (such as EUS-guided drainage or percutaneous transhepatic drainage), or surgery may then be considered.

Risk Factors

The overall risk of complications is higher in:

  • Younger patients and women (for pancreatitis specifically).
  • Patients with suspected sphincter of Oddi dysfunction.
  • People who have had previous post-ERCP pancreatitis.
  • Complex procedures involving the pancreatic duct.
  • Patients with bleeding disorders or on blood thinners.

Discussing your personal risk profile with your endoscopist before the procedure helps you make an informed decision.

ERCP in Children

ERCP can be performed in children, but it is a specialised procedure that is done in fewer centres than adult ERCP. Children may need ERCP for:

  • Bile duct stones, sometimes related to underlying blood disorders.
  • Choledochal cysts and other congenital duct abnormalities (often combined with surgical planning).
  • Bile leaks after liver or gallbladder surgery.
  • Pancreatic duct disruption after abdominal trauma.
  • Some cases of recurrent or chronic pancreatitis with duct abnormalities.

In children, ERCP is almost always done under general anaesthesia, by paediatric gastroenterologists or adult endoscopists with paediatric experience. Equipment is selected to suit the child’s size where possible. The risks are broadly similar to those in adults, with post-ERCP pancreatitis being the main concern.

For paediatric patients, decisions about whether and when to use ERCP are usually made jointly between paediatric gastroenterology, paediatric surgery, and anaesthesia teams, and non-invasive imaging (MRCP, EUS) is used wherever possible before committing to an invasive procedure.

Alternatives to ERCP

Whether an alternative is appropriate depends on what problem is being addressed. Several options may be considered alongside or instead of ERCP.

Non-invasive Imaging

When the question is mainly diagnostic — for example, “is there a stone in the bile duct?” — non-invasive imaging is usually preferred:

  • MRCP gives detailed pictures of the ducts without any instrument entering the body.
  • Endoscopic ultrasound (EUS) is more invasive than MRCP but does not enter the ducts; it is highly accurate for small stones and small tumours and is increasingly used to decide whether a therapeutic ERCP is needed.
Comparison diagram of three bile duct procedures: ERCP via endoscope, MRCP external MRI scan, and percutaneous transhepatic drainage through the skin.
Three approaches to bile duct diagnosis and drainage: ① ERCP using an endoscope through the mouth, ② MRCP as a non-invasive external MRI scan, ③ percutaneous transhepatic cholangiography with a needle through the skin and liver.
*AI-generated image - for illustration only. Clinical accuracy is not guaranteed.

If imaging shows no treatable duct problem, ERCP can often be avoided.

Percutaneous Transhepatic Cholangiography (PTC) and Drainage

When ERCP is not possible — for example, in altered surgical anatomy where the endoscope cannot reach the ampulla — an interventional radiologist may access the bile ducts through the skin and liver. A drainage tube or internal-external stent can be placed this way.

EUS-Guided Drainage

In some specialised centres, drainage of the bile duct or gallbladder can be performed using endoscopic ultrasound guidance, creating a connection between the stomach or duodenum and the duct. This is increasingly used when ERCP fails or is not feasible.

Surgery

Surgical exploration of the bile duct (open or laparoscopic common bile duct exploration) is an alternative to ERCP for bile duct stones, especially when surgery for gallbladder removal is already planned. The choice between “ERCP then cholecystectomy” and “cholecystectomy with bile duct exploration” depends on local expertise, available equipment, and patient factors. For some bile duct tumours and certain strictures, surgical resection is the definitive treatment, with ERCP playing a supporting role to relieve jaundice beforehand.

Watchful Waiting and Medical Therapy

For some problems — for example, very small bile duct stones that may pass on their own, or mild biliary changes without symptoms — doctors may suggest watching with repeat tests rather than proceeding straight to ERCP. Antibiotics, pain control, and treatment of underlying conditions may be enough in selected cases. ERCP is not used as a first-line investigation when there is no clear therapeutic target.

Life After ERCP

For most patients, ERCP is not an isolated event but part of a wider plan for the underlying condition.

After Bile Duct Stone Removal

If you had a stone removed from the bile duct and still have your gallbladder, doctors usually recommend gallbladder removal (cholecystectomy) within a reasonable timeframe to reduce the risk of further stones moving into the duct. The timing depends on your overall condition and local practice.

Living with a Stent

If a stent has been placed, you will be given clear instructions about when it needs to be reviewed. Plastic stents are usually exchanged or removed within a few months. Metal stents may stay longer or permanently, depending on the reason they were placed. Signs that a stent may be blocked include returning jaundice, fever, dark urine, pale stools, and upper abdominal pain — these should be reported promptly.

After ERCP for Tumours

When ERCP has been used to take tissue samples or relieve jaundice from a suspected tumour, the next steps usually involve multidisciplinary planning with surgical, oncology, and radiology teams. The ERCP itself is one piece of a larger treatment plan.

Diet and Lifestyle

There is no single “ERCP diet”. Diet advice is usually shaped by the underlying condition — for example, a lower-fat diet may be suggested while waiting for gallbladder surgery, and alcohol avoidance is important after pancreatitis. Your team will tailor advice to your situation.

Follow-up Tests

Depending on what was found, follow-up may include:

  • Repeat blood tests to check liver function and inflammation markers.
  • Imaging to confirm that the duct remains open and drainage is adequate.
  • Further endoscopic procedures to exchange or remove stents.
  • Specialist clinic review for chronic conditions such as chronic pancreatitis or primary sclerosing cholangitis.

Frequently Asked Questions

Is ERCP a surgery?

ERCP is not surgery in the traditional sense. No external cuts are made on the abdomen. It is an endoscopic procedure, but it is more complex than routine endoscopy and involves more risk, particularly when therapeutic steps such as sphincterotomy and stent placement are performed.

Will I be awake during ERCP?

No. ERCP is performed under deep sedation or general anaesthesia. Most people remember little or nothing of the procedure itself.

How long does ERCP take?

The procedure itself usually takes 30–90 minutes. With preparation, sedation, and recovery, the total time spent in the endoscopy unit is typically several hours.

Will I need to stay in hospital?

Many ERCPs are done as same-day or short-stay procedures. Overnight observation is common after complex therapeutic ERCPs, in older patients, or when there are risk factors for complications. Your team will advise you based on your individual case.

How soon can I return to work?

Most people return to non-physical work within 1–2 days. Heavier physical work, travel, and demanding schedules are usually best planned for a few days later, particularly while results and the need for further procedures are being reviewed.

Can I have another ERCP if needed?

Yes. Repeat ERCPs are common, especially when stents need to be exchanged or when a problem is treated in stages. Each procedure carries similar risks, although these may be modified by previous procedures and anatomy.

What happens if my ERCP is unsuccessful?

Occasionally the endoscopist cannot complete the planned therapy — for example, if the duct cannot be entered. Options then include a second attempt (sometimes at a referral centre with greater expertise), percutaneous drainage by an interventional radiologist, EUS-guided drainage, or surgery. The choice depends on the underlying problem and local expertise.

Is post-ERCP pancreatitis dangerous?

Most cases of post-ERCP pancreatitis are mild and settle within a few days with supportive care. A small minority can be severe. Preventive measures such as rectal anti-inflammatory medication and careful technique reduce the risk, and prompt recognition allows early treatment.

Does ERCP affect my long-term health?

A single uncomplicated ERCP does not usually have long-term effects on overall health. Long-term outcomes are mostly shaped by the underlying condition (stones, strictures, tumours, chronic pancreatitis) rather than by the procedure itself. Sphincterotomy slightly alters the anatomy of the duct opening, which can have small long-term implications that your doctor can explain.

Conclusion

ERCP is a specialised procedure that has changed the way doctors manage many bile duct and pancreatic duct problems. By combining endoscopy with X-ray imaging and a wide range of small instruments, it makes it possible to diagnose and treat conditions in a single session that once required open surgery.

It is also a procedure with real risks, which is why current practice reserves it for situations where a treatable duct problem is strongly suspected or already confirmed by other tests. Understanding what ERCP can do, what it cannot do, and what alternatives exist helps you take part in the decisions about your care. The most useful conversations happen with the endoscopy and gastroenterology team who know the details of your individual case, can explain the specific reason ERCP is being recommended for you, and can talk through what to expect before, during, and after the procedure.

Plan your treatment

ERCP in India — save up to 70% vs US/UK

Connect with 119+ specialists across 38 JCI/NABH hospitals. See cost details, compare hospitals, and meet the specialists.

Your Health Deserves the Best — Not the Most Expensive

Join 5,000+ patients from 40+ countries who chose world-class care at a fraction of the cost.

🔒 100% Free🏥 JCI Accredited💬 Counsellors Online🤝 No Obligation