Ankylosing Spondylitis (AS) is an inflammatory condition affecting the spine, which may lead to complications such as osteoporosis (OP). Many observational studies have demonstrated a close relationship with strong evidence between OP and AS. The combination of AS and OP is already an indisputable fact, but the exact mechanism of AS complicated with OP is unclear. To better prevent and treat OP in patients with AS, it is necessary to understand the specific mechanism of OP in these patients. In addition, there is a study showing that OP is a risk factor for AS, but the causal relationship between them is not yet clear. Therefore, we conducted a bidirectional Mendelian randomization (MR) analysis to determine whether there is a direct causal effect between AS and OP and to investigate the co-inherited genetic information between the two. Bone mineral density (BMD) was used as a phenotype for OP. The AS dataset was taken from the IGAS consortium and included people of European ancestry (9,069 cases and 13,578 controls). BMD datasets were obtained from the GEFOS consortium, a large GWAS meta-analysis study, and the UK Biobank and were categorized based on site (total body (TB): 56,284 cases; lumbar spine (LS): 28,498 cases; femoral neck (FN): 32,735 cases; forearm (FA): 8,143 cases; and heel: 265,627 cases) and age (0-15: 11,807 cases; 15-30: 4,180 cases; 30-45: 10,062 cases; 45-60: 18,062 cases; and over 60: 22,504 cases).To obtain the casual estimates, the inverse variant weighted (IVW) method was mainly used due to its good statistical power and robustness. The presence of heterogeneity was evaluated using Cochran's Q test. Pleiotropy was assessed utilizing MR-Egger regression and MR-pleiotropy residual sum and outlier (MR-PRESSO). Generally, there were no significant causal associations between genetically predicted AS and decreased BMD levels. The results of MR-Egger regression, Weighted Median, and Weighted Mode methods were consistent with those of the IVW method. However, there was a sign of a connection between genetically elevated BMD levels and a decreased risk of AS (Heel-BMD: OR = 0.879, 95% CI: 0.795-0.971, P = 0.012; Total-BMD: OR = 0.948, 95% CI: 0.907-0.990, P = 0.017; LS-BMD: OR = 0.919, 95% CI: 0.861-0.980, P = 0.010). The results were confirmed to be reliable by sensitivity analysis. This MR study found that the causal association between genetic liability to AS and the risk of OP or lower BMD in the European population was not evident, which highlights the second effect (e.g., mechanical reasons such as limited movement) of AS on OP. However, genetically predicted decreased BMD/OP is a risk factor for AS with a causal relationship, implying that patients with OP should be aware of the potential risk of developing AS. Moreover, OP and AS share similar pathogenesis and pathways.