Treatment survival with biological therapy may be influenced by many factors, and it seems to be different among various rheumatic diseases and biological agents. The goal of the study was to compare the drug survival and the causes of discontinuation of anti-tumoral necrosis factor (anti-TNF) therapy in ankylosing spondylitis (AS) with rheumatoid arthritis (RA). Study participants were a cohort from the Brazilian Registry of Biological Therapies in Rheumatic Diseases (BIOBADABRASIL) between 2008 and 2012. The observation time was up to 4 years following the introduction of the first treatment. Gender, age, disease duration, disease activity, comorbidities, and concomitant therapies were assessed. A total of 1303 patients were included: 372 had AS and 931 had RA in which 38.7 % (n = 504) used infliximab (IFX), 34.9 % (n = 455) used adalimumab (ADA), and 26.4 % (n = 344) used etanercept (ETA). The anti-TNF drug survival of patients with AS was 63.08 months (confidence interval (CI) 60.24, 65.92) and patients with RA was 47.5 months (CI 45.65, 49.36). It was significant higher in AS (log-rank; p ≤ 0.001). Patients with RA discontinued anti-TNF more than patients with AS when adjusted to gender and corticosteroid. The adjHR (95 % CI) was 1.6 (1.14, 2.31). Female patients who were also corticosteroid users, but not of advanced age, have shown lower survival for both diseases (log-rank, p ≤ 0.001). The discontinuation rate of IFX, but not of ADA or ETA, was significantly higher in RA than in SA; HR (95 % CI) was 2.49 (1.46, 4.24). The main causes of discontinuation were ineffectiveness and adverse event in both diseases. AS patients have better drug survival adjusted to gender, age, and corticosteroid. This results appear to be related to the disease mechanism.