The objective of this study was to investigate whether prophylactic administration of nafamostat mesilate reduces the incidence of post-endoscopic retrograde cholangiopancreatography (ERCP) pancreatitis (PEP), its efficacy, and risk factors for PEP. Potential subjects comprised 876 patients who underwent ERCP between September 2008 and February 2011. Of these, 58 patients were excluded after meeting exclusion criteria, and 818 patients were randomized. Patients in the nafamostat mesilate group were administered 20 mg of nafamostat mesilate dissolved in 500 mL of 5% glucose solution, whereas the control group received 500 mL of 5% glucose solution alone, over 2 hours from the start of ERCP. Post-ERCP pancreatitis occurred in 5.1% (41 patients) overall, with a significantly lower frequency in the nafamostat mesilate group (3.5%) than in the control group (6.7%; P = 0.0349). Analysis of the 322 patients who had undergone ERCP for the first time (n = 158 in the nafamostat mesilate group; n = 164 in the control group) found that PEP again significantly less frequently occurred in the nafamostat mesilate group (5.7%) than in the control group (13.4%; P = 0.0172). Our randomized controlled study suggested that short-term administration of nafamostat mesilate 20 mg may reduce the incidence of PEP.