ObjectiveThe development of ankylosing spondylitis (AS) is closely related to autoimmune system dysfunction. Type 1 diabetes mellitus (T1DM) is an autoimmune disease that is a risk factor for many diseases. This study aimed to investigate the causal relationship between T1DM mellitus and AS genetically.MethodsA genome-wide association study (GWAS) of causal relationships between exposure (T1DM) and outcome (AS) was performed using summary data from the GWAS database. We conducted a two-sample Mendelian randomization (MR) study of these two diseases. Inverse variance weighting (IVW) was used as the primary analysis method, with MR Egger, weighted median, and weighted mode used as supplementary methods. Sensitivity analyses were performed using Cochran’s Q test, MR-Egger intercept, MR-Pleiotropy RESidual Sum and outlier methods, leave-one-out analysis, and funnel plots.ResultsA total of 11 single nucleotide polymorphisms (SNPs)were identified for instrumental variables(IVs) for MR analysis.IVW found that T1DM was causally associated with AS ((IVW: OR = 1.0006 (95% CI 1.0001, 1.0011), p = 0.0057; MR-Egger: OR = 1.0003 (95% CI 0.9995, 1.0012), p = 0.4147; weighted median: OR = 1.0006 (95% CI 1.0003, 1.0008), p = 0.0001; weighted mode: OR = 1.0007 (95% CI 1.0005, 1.0009), p = 0.0001). No horizontal pleiotropy was found for the MR-Egger intercept, and leave -one-out analysis found that the results remained stable after the removal of individual SNPs.ConclusionThe results of the two-sample MR analysis supported a causal relationship between T1DM and AS risk.