ABSTRACT Objective Ankylosing spondylitis (AS) is a chronic inflammatory disease, might carry a high risk of irritable bowel syndrome (IBS) due to abnormal gut microbiota or inflammatory reaction. Methods We conducted a 14-year retrospective cohort study based on Taiwan’s National Health Insurance Research Database (NHIRD). A total of 4007 patients with newly diagnosed AS (outpatient visits≧3 times, or hospitalization≧1 time) and 988,084 non-AS comparisons were enrolled during 2000–2012. To ensure baseline comparability, the propensity score was matched by age, gender, comorbidities, and other possible confounders. The outcome was the incidence of IBS, followed up to the end of 2013. Cox proportional hazard model calculated adjusted hazard ratio (aHR) and the cumulative incidence of both groups was analyzed by the Kaplan-Meier method. Result After propensity score matching, baseline demographic characteristics were comparable between AS patients and the comparison group. The crude HR for IBS in the AS group was significantly higher 2.41 (95%C.I. = 1.84–3.16) than comparison group. After adjusting for possible confounders, adjusted HR was 2.50 (95%C.I. = 1.91–3.29). The cumulative incidence of IBS in AS was significantly higher than non-AS comparisons during the 14-year follow-up (P < 0.001). Conclusion This nationwide population-based cohort study showed that patients with AS have higher risks of IBS than those of the non-AS comparison group.