PurposeAnkylosing spondylitis (AS) is a risk factor for acute coronary syndrome (ACS). However, the influence of infectious insults, such as endophthalmitis, on the risk of ACS among AS patients has not been studied yet. In this study, we aimed to investigate the relationship between endophthalmitis in patients with AS and the incidence of ACS.MethodsThis retrospective cohort study extracted medical records from the Taiwan Longitudinal Health Insurance Database (LHID) from January 1, 2000, to December 31, 2015. The primary outcome was the incidence of ACS. Univariate and multivariate Cox regression analyses with and without Fine and Gray’s competing risk model and Kaplan–Meier survival curve were used for the analyses. Spearman’s rank correlation coefficient was performed for sensitivity analysis.ResultsWe identified 530 AS patients with endophthalmitis and 2,120 AS patients without endophthalmitis for comparison. The incidence rate of endophthalmitis in our study population was 2.66%. The overall incidence rate of ACS was 1,595.96 per 100,000 person-years in AS patients with endophthalmitis and 953.96 per 100,000 person-years in AS patients without endophthalmitis (adjusted HR = 1.787; 95% CI: 1.594–2.104, p < 0.001). In comparison to those without comorbidities, higher adjusted HRs were found in AS patients with endophthalmitis and comorbidities such as diabetes mellitus, hyperlipidemia, hypertension, cerebrovascular accident, congestive heart failure, chronic obstructive pulmonary disease, asthma, and coronary artery disease. Besides, the age ≥ 60 years revealed a high risk for ACS in AS patients with endophthalmitis.ConclusionEndophthalmitis was found to be an independent risk factor for ACS in patients with AS. Further clinical studies are required to elucidate the underlying mechanisms and status of systemic inflammation during endophthalmitis.