Background Anti-TNF drugs are effective treatments for the management of Crohn's disease but treatment failure is common. We aimed to identify clinical and pharmacokinetic factors that predict primary non-response at week 14 after starting treatment, non-remission at week 54, and adverse events leading to drug withdrawal.Methods The personalised anti-TNF therapy in Crohn's disease study (PANTS) is a prospective observational UK-wide study. We enrolled anti-TNF-naive patients (aged ≥6 years) with active luminal Crohn's disease at the time of first exposure to infliximab or adalimumab between March 7, 2013, and July 15, 2016. Patients were evaluated for 12 months or until drug withdrawal. Demographic data, smoking status, age at diagnosis, disease duration, location, and behaviour, previous medical and drug history, and previous Crohn's disease-related surgeries were recorded at baseline. At every visit, disease activity score, weight, therapy, and adverse events were recorded; drug and total anti-drug antibody concentrations were also measured. Treatment failure endpoints were primary non-response at week 14 ,non-remission at week 54, and adverse events leading to drug withdrawal. We used regression analyses to identify which factors were associated with treatment failure. Findings We enrolled 955 patients treated with infliximab (753 with originator; 202 with biosimilar) and 655 treated with adalimumab. Primary non-response occurred in 295 (23•8%, 95% CI 21•4-26•2) of 1241 patients who were assessable at week 14. Non-remission at week 54 occurred in 764 (63•1%, 60•3-65•8) of 1211 patients who were assessable, and adverse events curtailed treatment in 126 (7•8%, 6•6-9•2) of 1610 patients. In multivariable analysis, the only factor independently associated with primary non-response was low drug concentration at week 14 (infliximab: odds ratio 0•35 [95% CI 0•20-0•62], p=0•00038; adalimumab: 0•13 [0•06-0•28], p<0•0001); the optimal week 14 drug concentrations associated with remission at both week 14 and week 54 were 7 mg/L for infliximab and 12 mg/L for adalimumab. Continuing standard dosing regimens after primary non-response was rarely helpful; only 14 (12•4% [95% CI 6•9-19•9]) of 113 patients entered remission by week 54. Similarly, week 14 drug concentration was also independently associated with non-remission at week 54 (0•29 [0•16-0•52] for infliximab; 0•03 [0•01-0•12] for adalimumab; p<0•0001 for both). The proportion of patients who developed anti-drug antibodies (immunogenicity) was 62•8% (95% CI 59•0-66•3) for infliximab and 28•5% (24•0-32•7) for adalimumab. For both drugs, suboptimal week 14 drug concentrations predicted immunogenicity, and the development of anti-drug antibodies predicted subsequent low drug concentrations. Combination immuno-modulator (thiopurine or methotrexate) therapy mitigated the risk of developing anti-drug antibodies (hazard ratio 0•39 [95% CI 0•32-0•46] for infliximab; 0•44 [0•31-0•64] for adalimumab; p<0•0001 for both). For infliximab, multivariable analysis of immunododulator ...