BackgroundWhile observational research has highlighted a possible link between ankylosing spondylitis (AS) and type 2 diabetes (T2DM), the quality of evidence remains limited, and the causal relationship is yet to be established. This study aims to explore the causal link between AS and T2DM, as well as its impact on traits related to glucose metabolism.MethodTo infer a causal relationship between AS and various diabetes-related traits, including type 1 diabetes (T1DM), T2DM, blood glucose levels, fasting glucose, glycated hemoglobin, and fasting insulin, we employed Mendelian randomization (MR) analysis. We sourced GWAS summary data for both exposure and outcome variables from the IEU OpenGWAS database, GWAS Catalog, and FinnGen database. To synthesize the results of the MR analyses, we applied meta-analysis techniques using either a fixed or random effects model. For identifying and excluding instrumental variants (IVs) that exhibit horizontal pleiotropy with the outcomes, we utilized the MR-PRESSO method. Sensitivity analyses were conducted using the MR-Egger method, along with Q and I^2 tests, to ensure the robustness of our findings.ResultsOur analysis revealed a significant association between AS and an increased risk of T1DM with an odds ratio (OR) of 1.5754 (95% CI: 1.2935 to 1.9187) and T2DM with an OR of 1.0519 (95% CI: 1.0059 to 1.1001). Additionally, AS was associated with elevated levels of fasting glucose (beta coefficient = 0.0165, 95% CI: 0.0029 to 0.0301) and blood glucose (beta coefficient = 0.0280, 95% CI: 0.0086 to 0.0474), alongside a decrease in fasting insulin levels (beta coefficient = -0.0190, 95% CI: -0.0330 to -0.0050).ConclusionOur findings collectively underscore the detrimental impact of AS on the development of diabetes, highlighting the critical influence of autoimmune disorders in diabetes onset. This provides profound insights into the pathogenesis of diabetes from an immunological standpoint.