We have few population-level data onthe performance of endoscopic retrograde cholangiopancreatography (ERCP) in the United States. We investigated the numbers of unplanned hospital encounters (UHEs), patient and facility factors associated with UHEs, and variation in quality and outcomes in the performance of ERCP in 3 large American states. We collected data on 68,642 ERCPs, performed at 635 facilities in California, Florida, and New York from 2009 through 2014. The primary endpoint was number of UHEs with an ERCP-related event within 7 days of ERCP; secondary endpoints included number of UHEs within 30 days and mortality within 30 days. Each facility was assigned a risk-standardized cohort, and variations in number of UHEs were analyzed with multivariable analysis. Among all ERCPs, 5.8% resulted in a UHE within 7 days and 10.2% within 30 days. Performance of sphincterotomy was significantly associated with a higher risk of UHE at 7 and 30 days (P < .001). Younger age, female sex, and more advanced comorbidity were associated with UHE. There was substantial heterogeneity in rates of UHE among facilities: 4.2% at facilities in the 5th percentile and 25.2% at facilities in the 95th percentile. Increasing facility volume and ability to perform endoscopic ultrasonography were associated inversely with risk. The median number of ERCPs performed each year was 68.7, but 69% of facilities performed 100 or fewer ERCPs per year. Risk for UHE after sphincterotomy decreased with increasing facility volume until an inflection point of 157 ERCPs per year was reached. In an analysis of outcomes of 68,642 ERCPs performed in 3 states, we found a higher-than-expected number of UHEs. There is substantial unexplained variation in risk for adverse events after ERCPs among facilities, and volume is the strongest predictor of risk. Annual facility volumes above approximately 150 ERCPs per year may protect against UHE.