Tumour necrosis factor inhibitors (TNFis) have been suggested to slow radiographic progression in patients with ankylosing spondylitis. However, limitations such as variations in disease activity, complex drug administration and short follow-up duration make it difficult to determine the effect of TNFis on radiographic progression. The aim of the study was to investigate whether long-term treatment with TNFis can reduce radiographic progression in patients with ankylosing spondylitis using 18-year longitudinal real-world data.This retrospective study was conducted between January 2001 and December 2018 at a single centre. Among the 1280 patients whose electronic medical records were reviewed, data of 595 patients exposed to TNFis at least once were included. Among them, time intervals of TNFi exposure or non-exposure were determined in 338 patients ('on the TNFis' or 'off the TNFis' intervals, respectively). The difference in the modified Stoke Ankylosing Spondylitis Spinal Score (mSASSS) change rate between 'on the TNFis' and 'off the TNFis' intervals was investigated.We obtained 2364 intervals of 338 patients (1281 'on the TNFis' and 1083 'off the TNFis' intervals). In the marginal structural model for inverse probability of treatment weighting, the change rate of mSASSS significantly decreased with the use of TNFis (β=-0.112, p=0.004), and the adjusted mSASSS changes were 0.848 and 0.960 per year during 'on the TNFis' and 'off the TNFis' intervals, respectively.Compared with treatment without TNFis, treatment with TNFis slowed radiologic progression significantly.