Gefapixant is an oral P2X3 receptor antagonist that has previously shown efficacy and safety in refractory chronic cough and unexplained chronic cough. We therefore aim to confirm the efficacy and safety of gefapixant in participants with refractory chronic cough and unexplained chronic cough. COUGH-1 and COUGH-2 were both double-blind, randomised, parallel-group, placebo-controlled, phase 3 trials. COUGH-1 was done in 156 sites in 17 countries and COUGH-2 in 175 sites in 20 countries. We enrolled participants who were 18 years or older with a diagnosis of refractory chronic cough or unexplained chronic cough of 1 year duration or more. Participants were also required to have a cough severity visual analogue scale score of 40 mm or more at screening and baseline. Eligible participants were randomly allocated (1:1:1), using a computer-generated allocation schedule, to one of three treatment groups: placebo, gefapixant 15 mg twice per day, or gefapixant 45 mg twice per day. All study treatments were given orally. Participants were treated over a 12-week main study period in COUGH-1 and a 24-week main study period in COUGH-2; followed by extension periods for a total of up to 52 weeks of treatment in both trials. The primary outcome was placebo-adjusted mean change in 24-h cough frequency at 12 weeks in COUGH-1 and 24 weeks in COUGH-2. Both studies were registered with ClinicalTrials.gov, NCT03449134 (COUGH-1) and NCT03449147 (COUGH-2). From March 14, 2018, (first participant screened) to July 26, 2019, (last participant screened) 732 patients were recruited in COUGH-1 and 1317 in COUGH-2. COUGH-1 randomly assigned and treated 730 participants (243 [33×3%] with placebo, 244 [33×4%] with gefapixant 15 mg twice per day, and 243 [33×3%] with gefapixant 45 mg twice per day); COUGH-2 randomly assigned and treated 1314 participants (435 [33×1%] with placebo, 440 [33×5%] with gefapixant 15 mg twice per day, and 439 [33×4%] with gefapixant 45 mg twice per day). Participants were mostly female (542 [74×2%] of 730 in COUGH-1 and 984 [74×9%] of 1314 in COUGH-2). The mean age was 59×0 years (SD 12×6) in COUGH-1 and 58×1 years (12×1) in COUGH-2, and the mean cough duration was 11·6 years (SD 9·5) in COUGH-1 and 11·2 years (9·8) in COUGH-2. Gefapixant 45 mg twice per day showed significant reductions in 24-h cough frequency compared with placebo at week 12 in COUGH-1 (18·5% [95% CI 32·9-0·9]; p=0·041) and at week 24 in COUGH-2 (14·6% [26·1-1·4]; p=0·031). Gefapixant 15 mg twice per day did not show a significant reduction in cough frequency versus placebo in both studies. The most common adverse events were related to taste disturbance: ageusia (36 [4·9%] of 730 in COUGH-1 and 86 [6·5%] of 1314 in COUGH-2), dysgeusia (118 [16·2%] in COUGH-1 and 277 [21·1%] in COUGH-2), hypergeusia (3 [0·4%] in COUGH-1 and 6 [0×5%] in COUGH-2), hypogeusia (19 [2·6%] in COUGH-1 and 80 [6·1%] in COUGH-2), and taste disorder (28 [3·8%] in COUGH-1 and 46 [3·5%] in COUGH-2). Gefapixant 45 mg twice per day is the first treatment to show efficacy with an acceptable safety profile in phase 3 clinical trials for refractory chronic cough or unexplained chronic cough. Merck Sharp & Dohme.