To identify susceptibility loci for ankylosing spondylitis, we undertook a genome-wide association study in 2,053 unrelated ankylosing spondylitis cases among people of European descent and 5,140 ethnically matched controls, with replication in an independent cohort of 898 ankylosing spondylitis cases and 1,518 controls. Cases were genotyped with Illumina HumHap370 genotyping chips. In addition to strong association with the major histocompatibility complex (MHC; P < 10(-800)), we found association with SNPs in two gene deserts at 2p15 (rs10865331; combined P = 1.9 x 10(-19)) and 21q22 (rs2242944; P = 8.3 x 10(-20)), as well as in the genes ANTXR2 (rs4333130; P = 9.3 x 10(-8)) and IL1R2 (rs2310173; P = 4.8 x 10(-7)). We also replicated previously reported associations at IL23R (rs11209026; P = 9.1 x 10(-14)) and ERAP1 (rs27434; P = 5.3 x 10(-12)). This study reports four genetic loci associated with ankylosing spondylitis risk and identifies a major role for the interleukin (IL)-23 and IL-1 cytokine pathways in disease susceptibility.