Patients with gallstones are prone to pancreatitis after treatment using endoscopic retrograde cholangiopancreatography (ERCP). The aim of this study was to explore the risk factors for pancreatitis occurrence after gallstone treatment using ERCP. A total of 193 patients treated from October 2017 to October 2020 were assigned into pancreatitis group (n=55) and non-pancreatitis group (n=138). Multivariate logistic regression analysis was utilized to analyse the risk factors for post-ERCP pancreatitis. The discrimination and accuracy of an established nomogram model were evaluated using receiver operating characteristic and calibration curves, respectively. The incidence rate of pancreatitis was 28.50% (55/193). Young age, long course of disease, gallbladder wall thickness >3 mm, sand-like stones, history of pancreatic disease, number of intubation ≥2 and absence of pancreatic duct stenting were risk factors for post-ERCP pancreatitis (P<0.05). The established model had high discrimination and accuracy. The incidence rates of pancreatitis in patients with and without pancreatic duct stenting were 11.84% (9/76) and 39.31% (46/117), respectively. The patients undergoing pancreatic duct stenting had lower serum amylase levels 6, 12 and 24 h after ERCP than those of patients who did not. Patients with gallstones have a higher risk of developing pancreatitis. Young age, long course of disease, gallbladder wall thickness >3 mm, sand-like stones, history of pancreatic disease, pancreatic duct visualization and number of intubation ≥2 are risk factors for post-ERCP pancreatitis.