Background & Aims Acute pancreatitis may be a risk factor for pancreatic cancer. However, findings from studies on this association are conflicting. We investigated the association between acute pancreatitis and increased risk of pancreatic cancer. Methods We conducted a nationwide, population-based, matched cohort study of all patients admitted to a hospital in Denmark with a diagnosis of acute pancreatitis from January 1, 1980 through October 31, 2012. As many as 5 individuals from the general population without acute pancreatitis were matched for age and sex to each patient with acute pancreatitis. Pancreatic cancer risk was expressed as hazard ratios (HRs) with 95% CIs, calculated using the Cox proportional hazards model. Cox models were stratified by age, sex, and year of pancreatitis diagnosis and adjusted for alcohol- and smoking-related conditions, and Charlson Comorbidity Index score. Results We included 41,669 patients diagnosed with incident acute pancreatitis and 208,340 comparison individuals. Patients with acute pancreatitis had an increased risk of pancreatic cancer compared with the age- and sex-matched general population throughout the follow-up period. The risk decreased over time but remained high after more than 5 years of follow up (adjusted HR, 2.02; 95% CI, 1.57–2.61). Two- and 5-year absolute risks of pancreatic cancer among patients with acute pancreatitis were 0.68% (95% CI, 0.61%–0.77%) and 0.85% (95% CI, 0.76%–0.94), respectively. Conclusions In a nationwide, population-based, matched cohort study, we observed an association between diagnosis of acute pancreatitis and long-term risk of pancreatic cancer.