Background: Use of maintenance antibiotic therapy with the macrolide azithromycin is increasing in a number of chronic respiratory disorders including primary ciliary dyskinesia (PCD). However, evidence for its efficacy in PCD is lacking. We aimed to determine the efficacy and safety of azithromycin maintenance therapy for 6 months in patients with PCD. Methods: The Better Experimental Screening and Treatment for Primary Ciliary Dyskinesia (BESTCILIA) trial was a multicentre, double-blind, parallel group, randomised, placebo-controlled phase 3 trial done at 6 European PCD clinics (tertiary paediatric care centres and university hospitals in Denmark, Germany, Netherlands, Switzerland, and UK). Patients with a confirmed diagnosis of PCD, aged 7–50 years old, and predicted FEV1 greater than 40% were recruited. Participants were randomly assigned (1:1), stratified by age and study site, via a web-based randomisation system to azithromycin 250 mg or 500 mg as tablets according to bodyweight (</≥ 40 kg) or identical placebo, three times a week for 6 months. The random allocation sequence was a permuted block randomisation, with a block size of four, generated by an external consultancy. Participants, investigators, and care providers were masked to treatment allocation. The primary endpoint was the number of respiratory exacerbations over 6 months. Analysis was by intention to treat. This study is registered in the EU Clinical Trials Register, EudraCT number 2013-004664-58. Findings: Between June 24, 2014, and Aug 23, 2016, 102 patients were screened, of whom 90 were randomly assigned to either azithromycin (n=49) or placebo (n=41). The study was ended without having included the planned number of participants due to recruitment difficulties. The mean number of respiratory exacerbations over 6 months was 0·75 (SD 1·12) in the azithromycin group compared with 1·62 (1·64) in the placebo group, and participants receiving azithromycin had significantly lower rate of exacerbations during the individual treatment periods (rate ratio 0·45 [95% CI 0·26–0·78]; p=0·004). Four serious adverse events were reported, occurring in one (2%) of 47 participants in the azithromycin group and in three (7%) of 41 participants in the placebo group. Loose stools or diarrhoea were more common in the azithromycin group than in the placebo group (11 [23%] vs two [5%]). Interpretation: This first multinational randomised controlled trial on pharmacotherapy in PCD showed that azithromycin maintenance therapy for 6 months was well tolerated and halved the rate of respiratory exacerbations. Azithromycin maintenance therapy is an option for patients with PCD with frequent exacerbations potentially leading to reduced need for additional antibiotic treatments and preventing irreversible lung damage. Funding: European Commission Seventh Framework Programme and Children's Lung Foundation (Denmark).