Objective. To compare baseline disease activity and treatment effectiveness in biologic-naive patients with nonradiographic axial spondyloarthritis (nr-axSpA) and ankylosing spondylitis (AS) who initiate tumor necrosis factor inhibitor (TNFi) treatment and to study the role of potential confounders (e.g., HLA-B27 status). Methods. Observational cohort study based on prospectively registered data in the nationwide DANBIO registry. We used Kaplan-Meier plots, Cox, and logistic regression analyses to study the effect of diagnosis (nr-axSpA vs AS) and potential confounders (sex/age/start yr/HLA-B27/disease duration/TNFi-type/smoking/baseline disease activity) on TNFi adherence and response [e.g., Bath Ankylosing Spondylitis Activity Index (BASDAI) 50%/20 mm]. Results. The study included 1250 TNFi-naive patients with axSpA (29% nr-axSpA, 50% AS, 21% lacked radiographs of sacroiliac joints). Patients with nr-axSpA were more frequently women (50%/27%) and HLA-B27-negative (85/338 = 25%), compared to AS (81/476 = 17%; p < 0.01). At TNFi start patients with nr-axSpA had higher visual analog scale scores [median (quartiles)] for pain: 72 mm (55-84)/65 mm (48-77); global: 76 mm (62-88)/68 mm (50-80); fatigue: 74 mm (55-85)/67 mm (50-80); and BASDAI: 64 (54-77)/59 (46-71); all p < 0.01. However, patients with nr-axSpA had lower C-reactive protein: 7 mg/l (3-17)/11 mg/l (5-22); and BAS Metrology Index: 20 (10-40)/40 (20-50); all p0.05). HLA-B27 negativity was associated with poorer treatment adherence [HLA-B27 negative/positive, nr-axSpA: HR 1.74 (1.29-2.36), AS: HR 2.04 (1.53-2.71), both p < 0.0001]; and lower response rates (nr-axSpA: 18/61 = 30% vs 93/168 = 55%; AS: 17/59 = 29% vs 157/291 = 54%, both p < 0.05). Conclusion. In this nationwide cohort, patients with nr-axSpA had higher subjective disease activity at start of first TNFi treatment, but similar outcomes to patients with AS after confounder adjustment. HLA-B27 positivity was associated with better outcomes irrespective of axSpA subdiagnosis.