Background-Physical activity enhances the uptake of air pollutants, possibly reducing its beneficial effects. We examined the effects of leisure-time and transport-related physical activities on the risk of myocardial infarction (MI), and whether potential benefits on MI are reduced by exposure to traffic-related air pollution. Methods and Results-A group of 57 053 participants (50–65 years of age) from the Danish Diet, Cancer, and Health cohort reported physical activity at baseline (1993–1997) and were linked to registry data on hospital contacts and out-of-hospital deaths caused by MI, until December 2015. Nitrogen dioxide levels were estimated at participants’ baseline residences. We used Cox regressions to associate participation in sports, cycling, walking, and gardening with incident and recurrent MI, and tested for interaction by nitrogen dioxide. Of 50 635 participants without MI at baseline, 2936 developed incident MI, and of 1233 participants with MI before baseline, 324 had recurring MI during follow-up. Mean nitrogen dioxide concentration was 18.7 µg/m3 at baseline (1993-1997). We found inverse statistically significant associations between participation in sports (hazard ratio; 95% confidence interval: 0.85; 0.79–0.92), cycling (0.91; 0.84–0.98), gardening (0.87; 0.80–0.95), and incident MI, while the association with walking was statistically nonsignificant (0.95; 0.83–1.08). Recurrent MI was statistically nonsignificantly inversely associated with cycling (0.80; 0.63–1.02), walking (0.82, 0.57–1.16), and gardening (0.91; 0.71–1.18), and positively with sports (1.06; 0.83–1.35). There was no effect modification of the associations between physical activity and MI by nitrogen dioxide. Conclusions-Benefits of physical activity on both the incidence and the recurrence of MI are not reduced by exposure to high levels of air pollution.