BackgroundAnkylosing spondylitis (AS) results from the combined effects of susceptibility genes and environmental factors. Polymorphisms in genes regulating inflammation may explain part of the heritability of AS.MethodsUsing a candidate gene approach in this case-control study, 51 mainly functional single nucleotide polymorphisms (SNPs) in genes regulating inflammation were assessed in 709 patients with AS and 795 controls. Data on the patients with AS were obtained from the DANBIO registry where patients from all of Denmark are monitored in routine care during treatment with conventional and biologic disease modifying anti-rheumatic drugs (bDMARDs).The results were analyzed using logistic regression (adjusted for age and sex).ResultsNine polymorphisms were associated with risk of AS (p < 0.05). The polymorphisms were in genes regulating a: the TNF-α pathway (TNF -308 G > A (rs1800629), and − 238 G > A (rs361525); TNFRSF1A -609 G > T (rs4149570), and PTPN22 1858 G > A (rs2476601)), b: the IL23/IL17 pathway (IL23R G > A (rs11209026), and IL18–137 G > C (rs187238)), or c: the NFkB pathway (TLR1 743 T > C (rs4833095), TLR4 T > C (rs1554973), and LY96–1625 C > G (rs11465996)).After Bonferroni correction the homozygous variant genotype of TLR1 743 T > C (rs4833095) (odds ratios (OR): 2.59, 95% confidence interval (CI): 1.48–4.51, p = 0.04), and TNFRSF1A -609 G > T (rs4149570) (OR: 1.79, 95% CI: 1.31–2.41, p = 0.01) were associated with increased risk of AS and the combined homozygous and heterozygous variant genotypes of TNF -308 G > A (rs1800629) (OR: 0.56, 95% CI: 0.44–0.72, p = 0.0002) were associated with reduced risk of AS.ConclusionWe replicated associations between AS and the polymorphisms in TNF (rs1800629), TNFRSF1A (rs4149570), and IL23R (rs11209026). Furthermore, we identified novel risk loci in TNF (rs361525), IL18 (rs187238), TLR1 (rs4833095), TLR4 (rs1554973), and LY96 (rs11465996) that need validation in independent cohorts. The results suggest that genetically determined high activity of the TNF-α, IL23/IL17, and NFkB pathways increase risk of AS.