BackgroundAlthough 25-hydroxyvitamin D [25(OH)D] is a risk factor for osteoporosis, it is not clear whether sex hormones mediate this casual association. We aimed to explore how sex hormones affect the association between 25(OH)D and osteoporosis to provide meaningful insights on the underlying mechanisms from a genetic perspective.MethodsGenetic variations in 25(OH)D, total testosterone (TT), androstenedione (A4), estradiol (E2), and testosterone/17β-estradiol (T/E2) were determined through summary statistics. Taking osteoporosis as the outcome (FinnGen biobank, 332,020 samples), we conducted a Mendelian randomization (MR) analysis to establish the association between 25(OH)D and these sex hormones. The two-step MR analysis quantified the mediatory effects of sex hormones on osteoporosis. The results were further verified by pleiotropy and heterogeneity analyses.ResultsMR results showed that 25(OH)D (OR= 1.27, p = 0.04) and TT (OR= 1.25, p = 0.04) had a causal effect on osteoporosis. No significant associations were observed between the other sex hormones (A4, E2, and T/E2) and osteoporosis (p>0.05). Sensitivity analysis (p>0.05) confirmed the robustness of the MR results. The two-step MR analysis provided evidence that the mediatory effect of TT was 0.014 (the percentage of TT mediation was 5.91%). Moreover, the direct effect of 25(OH)D on osteoporosis was 0.221. A4, E2, and T/E2 were not considered as potential mediators of the role of 25(OH)D as a risk factor for OP.ConclusionThis study, through MR analysis, showed that TT mediates the causal effect of 25(OH)D on osteoporosis. Interventions targeting TT, therefore, have the potential to substantially reduce the burden of osteoporosis attributable to high 25(OH)D.