Before removal of retained pancreatic stents placed during endoscopic retrograde cholangiopancreatography to avoid post-ERCP pancreatitis, imaging is recommended. The aim of the present study was to evaluate a new ultrasound-based algorithm.Patients who received a pancreatic stent for PEP prophylaxis were included. Straight 5Fr (0.035inch) 6cm stents with an external flap that were visualized by ultrasound were removed endoscopically with no further imaging. If the ultrasound result reported the stent to be dislodged or was inconclusive, X-ray imaging was performed. The endpoints were positive and negative predictive value, specificity, sensitivity, and contingency coefficient between ultrasound and X-ray and/or endoscopy.88 patients were enrolled in the present study. X-ray was performed in 23 (26%) patients. Accordingly, the ultrasound algorithm saved an X-ray examination in 65 cases, leading to a reduction of 74%. Stents were retained in 67 patients (76%) and visualized correctly by ultrasound in 54 patients with a sensitivity of 81%. The positive predictive value was 83%. The specificity was 48%, because ultrasound described 10/21 dislodged stents correctly. The negative predictive value was 43%, since 10/23 stents were correctly classified by ultrasound as dislodged. In 11 patients (13%), esophagogastroduodenoscopy was performed even though the pancreatic stent was already dislodged.A novel ultrasound-based algorithm reduced the need for X-ray imaging by three quarters. To avoid unnecessary endoscopic examinations, the algorithm should be implemented with a learning phase and procedures should be performed by experienced examiners. An important limitation might be stent length since shorter stents might be more difficult to visualize by ultrasound.