Smoking has been associated with opposing risks of ulcerative colitis and Crohn's disease. Whether these observational associations reflect actual causal associations, confounding, or reverse causation is unclear. Using a Mendelian randomization approach, we tested the hypothesis that smoking protects against ulcerative colitis and is a cause of Crohn's disease. We included 118,683 white Danes aged ≥ 20 from the Copenhagen General Population Study (2003-2015) and the Copenhagen City Heart Study (1991-94 and 2001-03). During follow-up until 2018, we investigated the association of smoking and CHRNA3 rs1051730, where the T-allele is strongly associated with nicotine dependence, with risk of ulcerative colitis and Crohn's disease. We identified 1312 cases of ulcerative colitis and 671 cases of Crohn's disease. Compared to never-smokers, multivariable adjusted hazard ratios (HRs) for ulcerative colitis were 1.69(95% confidence interval [CI] 1.32-2.15) in former smokers and 2.27(1.74-2.96) in current smokers. Corresponding HRs for Crohn's disease were 1.31(0.93-1.84) and 1.93(1.34-2.78), respectively. Among ever-smokers when compared to non-carriers of the CHRNA3 rs1051730 T-allele, age and sex adjusted HRs for risk of ulcerative colitis were 1.03(95%CI 0.89-1.18) in heterozygotes and 0.91(0.72-1.16) in homozygotes. Corresponding HRs for Crohn's disease were 1.05(0.87-1.28) and 1.02(0.74-1.41), respectively. In a meta-analysis combined with UK Biobank, there was no evidence that CHRNA3 rs1051730 was associated with risk of ulcerative colitis or Crohn's disease. In conclusion, current versus never-smoking was associated with unexpected 2.3-fold risk of ulcerative colitis and expected 1.9-fold risk of Crohn's disease in prospective analyses; however, genetic evidence of lifelong increased smoking intensity did not support causal relationships.