Background and study aims Endoscopic papillectomy (EP) is a minimally invasive treatment for ampullary neoplasms and is recognized as an alternative treatment to surgical resection; however, there are few reports on a suitable pancreatic stent (PS) after EP for preventing pancreatitis. The aim of this study was to evaluate the efficacy of a long PS after EP. Patients and methods In this retrospective single-center study, 39 patients with pathologically proven ampullary neoplasms who underwent EP between March 2012 and August 2018 were enrolled. The study participants were divided into two subgroups according to the PS length: those with a PS shorter than 5 cm (short PS group, n = 17) and those with a PS of 7 cm (long PS group, n = 22). The incidence of adverse events and risk factors for pancreatitis were evaluated. Results The diameter of all PSs was 5 Fr. Post-EP pancreatitis occurred in nine patients (23.1 %), with two cases of severe pancreatitis (5.1 %). Pancreatitis occurred more frequently in the short PS group (7/17, 41.2 %) than in the long PS group (2/22, 9.1 %) ( P = 0.026). There were no significant differences between the two groups in terms of other adverse events. Univariate and multivariate analyses showed that a long PS was the only factor associated with a decreased incidence of post-EP pancreatitis ( P = 0.042; odds ratio, 0.16; 95 % confidence interval, 0.027-0.94). Conclusion A long (7 cm) PS significantly decreased incidence of pancreatitis after EP. Prospective randomized studies with a larger number of patients and wider range of PS lengths are required.