Prenatal vitamin D insufficiency may be associated with an increased risk of developing childhood asthma. Results from epidemiological studies are conflicting and limited by short follow-up and small sample sizes. The objective of this study was to examine if children born to women exposed to the margarine fortification policy with a small dose of extra vitamin D during pregnancy had a reduced risk of developing asthma until age 9 years, compared to children born to unexposed women. The termination of a Danish mandatory vitamin D fortification policy constituted the basis for the study design. We compared the risk of inpatient asthma diagnoses in all Danish children born two years before (n = 106,347, exposed) and two years after (n = 115,900, unexposed) the termination of the policy. The children were followed in the register from 0-9 years of age. Data were analyzed using Cox proportional hazards regression. The Hazard Ratio for the first inpatient asthma admission among exposed versus unexposed children was 0.96 (95%CI: 0.90-1.04). When stratifying by sex and age, 0-3 years old boys exposed to vitamin D fortification showed a lower asthma risk compared to unexposed boys (HR 0.78, 95%CI: 0.67-0.92). Prenatal exposure to margarine fortification policy with extra vitamin D did not affect the overall risk of developing asthma among children aged 0-9 years but seemed to reduce the risk among 0-3 years old boys. Taking aside study design limitations, this could be explained by different sensitivity to vitamin D from different sex-related asthma phenotypes in children with early onset, and sex differences in lung development or immune responses.