We conducted a Mendelian randomization study to determine the potential causal associations of gallstone disease, diabetes, serum calcium, triglyceride levels, smoking and alcohol consumption with acute and chronic pancreatitis. Genetic variants associated with the exposures at p < 5 × 10-8 were selected from corresponding genome-wide association studies. Summary-level data for pancreatitis were obtained from the FinnGen consortium and UK Biobank. Univariable and multivariable Mendelian randomization analyses were performed and results from FinnGen and UK Biobank were combined using the fixed-effects meta-analysis method. Genetic predisposition to gallstone disease, type 2 diabetes and smoking initiation was associated with an increased risk of acute pancreatitis. The combined odds ratios (ORs) were 1.74 (95% confidence interval (CI), 1.57, 1.93) for gallstone disease, 1.14 (95% CI, 1.06, 1.21) for type 2 diabetes and 1.56 (95% CI, 1.32, 1.83) for smoking initiation. The association for type 2 diabetes attenuated after adjustment for gallstone disease. Genetic predisposition to gallstone disease and smoking initiation as well as higher genetically predicted serum calcium and triglyceride levels were associated with an increased risk of chronic pancreatitis. The combined ORs of chronic pancreatitis were 1.27 (95% CI, 1.08, 1.50) for gallstone disease, 1.86 (95% CI, 1.43, 2.43) for smoking initiation, 2.20 (95% CI, 1.30, 3.72) for calcium and 1.47 (95% CI, 1.23, 1.76) for triglycerides. This study provides evidence in support that gallstone disease, type 2 diabetes, smoking and elevated calcium and triglyceride levels are causally associated with the risk of acute or chronic pancreatitis.