Ankylosing spondylitis (AS) is a highly heritable immune-mediated arthritis common in Turkish and Iranian populations. Familial Mediterranean Fever (FMF) is an autosomal recessive autoinflammatory disease most common in people of Mediterranean origin. MEFV, an FMF-associated gene, is also a candidate gene for AS. We aimed to identify AS susceptibility loci and also examine the association between MEFV and AS in Turkish and Iranian cohorts. We performed genome-wide association studies in 1001 Turkish AS patients and 1011 Turkish controls, and 479 Iranian AS patients and 830 Iranian controls. Serum IL-1β, IL-17 and IL-23 cytokine levels were quantified in Turkish samples. An association of major effect was observed with a novel rare coding variant in MEFV in the Turkish cohort (rs61752717, M694V, OR = 5.3, P = 7.63×10(-12)), Iranian cohort (OR = 2.9, P = 0.042), and combined dataset (OR = 5.1, P = 1.65×10(-13)). 99.6% of Turkish AS cases, and 96% of those carrying MEFV rs61752717 variants, did not have FMF. In Turkish subjects, the association of rs61752717 was particularly strong in HLA-B27-negative cases (OR = 7.8, P = 8.93×10(-15)), but also positive in HLA-B27-positive cases (OR = 4.3, P = 7.69×10(-8)). Serum IL-1β, IL-17 and IL-23 levels were higher in AS cases than controls. Among AS cases, serum IL-1β and IL-23 levels were increased in MEFV 694V carriers compared with non-carriers. Our data suggest that FMF and AS have overlapping aetiopathogenic mechanisms. Functionally important MEFV mutations, such as M694V, lead to dysregulated inflammasome function and excessive IL-1β function. As IL-1 inhibition is effective in FMF, AS cases carrying FMF-associated MEFV variants may benefit from such therapy.