This study aimed to investigate whether variation in the functional 17q21 single nucleotide polymorphism rs12936231 affects the preventive potential of vitamin D against asthma.A combined secondary analysis of two randomised controlled trials of prenatal vitamin D supplementation for the prevention of asthma in offspring (Vitamin D Antenatal Asthma Reduction Trial (VDAART) and Copenhagen Prospective Studies on Asthma in Childhood 2010 (COPSAC<sub>2010</sub>)) was performed, stratifying by genotype and integrating metabolite data to explore underlying mechanisms.The protective effect of vitamin D on asthma/wheeze was evident among children with the low-risk rs12936231 GG genotype (hazard ratio (HR) 0.49, 95% CI 0.26-0.94, p=0.032) but not the high-risk CC genotype (HR 1.08, 95% CI 0.69-1.69, p=0.751).