Ankylosing spondylitis (AS) is known to increase the risk of stroke. Among patients with AS, uveitis is the most common extra-articular manifestation. However, no previous investigations have discussed the association between uveitis and the risk for developing stroke in patients with AS. This retrospective cohort study aimed to explore the relationship between uveitis and the incidence of stroke in patients with AS by obtaining medical records from January 1, 2000, to December 31, 2015, from the National Health Insurance Research Database, according to the International Classification of Diseases, 9th Revision, Clinical Modification diagnosis codes. The primary outcome was the incidence of stroke. Pearson’s chi-square test and Fisher’s exact test were used to analyze variables. Kaplan–Meier survival curves and univariate and multivariate Cox proportional hazard regression models with and without Fine and Gray’s competing risk model were used to analyze data. Total 828 AS patients with uveitis and 3,312 AS patients without uveitis were identified. During the follow-up period, 137 patients in the uveitis group and 344 in the non-uveitis group developed stroke. Uveitis is a significant risk factor for stroke development in patients with AS (adjusted hazard ratio = 1.846, p < 0.001). Age, diabetes mellitus, hyperlipidemia, hypertension, congestive heart failure, chronic obstructive pulmonary disease, asthma, coronary artery disease, and atrial fibrillation were associated with a higher risk of stroke. After subgroup analysis, both anterior uveitis and posterior segment involvement were found to increase the risk of stroke in patients with AS. Uveitis is associated with an increased risk in both ischemic and hemorrhagic strokes in patients with AS. Therefore, when uveitis is identified, clinicians should pay more attention to the cerebrovascular risk in patients with AS, especially in those with underlying comorbidities.