Background: Air pollution is speculated to affect the reproductive health of women. However, a longitudinal association between exposure to air pollution and dysmenorrhea has not been identified, which this study aimed to examine this point.Methods: Two nationwide databases, namely the Taiwan Air Quality Monitoring database and the Taiwan National Health Research Institutes database were linked. Women with a history of dysmenorrhea (International Classification of Disease, Ninth Revision, Clinical Modification code 625.3) before 2000 were excluded. All participants were followed from January 1, 2000 until the diagnosis of dysmenorrhea, withdrawal from National Health Insurance, or December 31, 2013. Furthermore, air pollutants were categorized into quartiles with three cut-off points (25th, 50th, and 75th percentiles). The Cox regression model was used to calculate the hazard ratios of dysmenorrhea.Results: This study enrolled 296,078 women. The mean concentrations of yearly air pollutants were 28.2 (±12.6) ppb for nitric oxides (NOx), 8.91 (±7.93) ppb for nitric oxide (NO), 19.3 (±5.49) ppb for nitrogen dioxide (NO2), 0.54 (±0.18) ppm for carbon monoxide (CO), and 31.8 (±6.80) μg/m3 for PM2.5. In total, 12,514 individuals developed dysmenorrhea during the 12-year follow-up. Relative to women exposed to Q1 concentrations of NOx, women exposed to Q4 concentrations exhibited a significantly higher dysmenorrhea risk [adjusted hazard ratio (aHR)= 27.9, 95% confidence interval (CI) = 21.6–31.3]; similarly higher risk was found for exposure to NO (aHR = 16.7, 95% CI = 15.4–18.4) and NO2 (aHR = 33.1, 95% CI = 30.9–37.4). For CO, the relative dysmenorrhea risk in women with Q4 level exposure was 28.7 (95% CI = 25.4–33.6). For PM2.5, women at the Q4 exposure level were 27.6 times (95% CI = 23.1–29.1) more likely to develop dysmenorrhea than those at the Q1 exposure level.Conclusion: Our results showed that women would have higher dysmenorrhea incidences while exposure to high concentrations of NO, NO2, NOx, CO, and PM2.5.