Myopia is caused by complex genetic and environmental factors. However, information regarding the effect of long-term exposure to air pollutants on the risk of development of myopia is lacking. We collected data from two linked databases: the Taiwan National Health Insurance Research Database (NHIRD) and the Taiwan Air Quality-Monitoring Database (TAQMD). A total of 15,822 children (16.3%) were diagnosed with myopia within the cohort. The incidence rate of myopia increased with exposure to increasing concentrations of particulate matter (PM2.5) and nitrogen oxides (NOx), increasing from 15.8 to 24.5 and from 13.7 to 34.4, per 1000 person-years, respectively. The adjusted hazard ratio for myopia increased with elevated PM2.5 and NOx exposure concentrations in Q4 to 1.57 and 2.60, respectively, compared to those exposed to the corresponding concentrations in Q1. In the animal experiments, PM2.5 induced myopia in hamsters by enhancing inflammation and was inhibited by resveratrol treatment compared to the control group. The change in axial length in the PM2.5 group was 0.386 ± 0.069 mm versus 0.287 ± 0.086 mm in the control group and 0.257 ± 0.059 mm in the PM2.5 + resveratrol group. We provide both clinical and experimental correlations that exposure to ambient air pollutants is associated with the pathogenesis of myopia.