Most patients with irritable bowel syndrome (IBS) are managed in primary care. When first-line therapies for IBS are ineffective, the UK National Institute for Health and Care Excellence guideline suggests considering low- dose tricyclic antidepressants as second-line treatment, but their effectiveness in primary care is unknown, and they are infrequently prescribed in this setting. This randomised, double-blind, placebo-controlled trial (Amitriptyline at Low-Dose and Titrated for Irritable Bowel Syndrome as Second-Line Treatment [ATLANTIS]) was conducted at 55 general practices in England. Eligible participants were aged 18 years or older, with Rome IV IBS of any subtype, and ongoing symptoms (IBS Severity Scoring System [IBS-SSS] score ≥75 points) despite dietary changes and first-line therapies, a normal full blood count and C-reactive protein, negative coeliac serology, and no evidence of suicidal ideation. Participants were randomly assigned (1:1) to low-dose oral amitriptyline (10 mg once daily) or placebo for 6 months, with dose titration over 3 weeks (up to 30 mg once daily), according to symptoms and tolerability. Participants, their general practitioners, investigators, and the analysis team were all masked to allocation throughout the trial. The primary outcome was the IBS-SSS score at 6 months. Effectiveness analyses were according to intention-to-treat; safety analyses were on all participants who took at least one dose of the trial medication. This trial is registered with the ISRCTN Registry (ISRCTN48075063) and is closed to new participants. Between Oct 18, 2019, and April 11, 2022, 463 participants (mean age 48·5 years [SD 16·1], 315 [68%] female to 148 [32%] male) were randomly allocated to receive low-dose amitriptyline (232) or placebo (231). Intention-to-treat analysis of the primary outcome showed a significant difference in favour of low-dose amitriptyline in IBS-SSS score between groups at 6 months (-27·0, 95% CI -46·9 to -7·10; p=0·0079). 46 (20%) participants discontinued low-dose amitriptyline (30 [13%] due to adverse events), and 59 (26%) discontinued placebo (20 [9%] due to adverse events) before 6 months. There were five serious adverse reactions (two in the amitriptyline group and three in the placebo group), and five serious adverse events unrelated to trial medication. To our knowledge, this is the largest trial of a tricyclic antidepressant in IBS ever conducted. Titrated low-dose amitriptyline was superior to placebo as a second-line treatment for IBS in primary care across multiple outcomes, and was safe and well tolerated. General practitioners should offer low-dose amitriptyline to patients with IBS whose symptoms do not improve with first-line therapies, with appropriate support to guide patient-led dose titration, such as the self-titration document developed for this trial. National Institute for Health and Care Research Health Technology Assessment Programme (grant reference 16/162/01).