BACKGROUND Melioidosis, an infectious disease caused by the Gram-negative bacillus Burkholderia pseudomallei, is difficult to cure. Antimicrobial treatment comprises intravenous drugs for at least 10 days, followed by oral drugs for at least 12 weeks. The standard oral regimen based on trial evidence is trimethoprim-sulfamethoxaxole (TMP-SMX) plus doxycycline. This regimen is used in Thailand but is associated with side-effects and poor adherence by patients, and TMP-SMX alone is recommended in Australia. We compared the efficacy and side-effects of TMP-SMX with TMP-SMX plus doxycycline for the oral phase of melioidosis treatment. METHODS For this multi-centre, double-blind, non-inferiority, randomised placebo-controlled trial, we enrolled patients (aged ≥15 years) from five centres in northeast Thailand with culture-confirmed melioidosis who had received a course of parenteral antimicrobial drugs. Using a computer-generated sequence, we randomly assigned patients to receive TMP-SMX plus placebo or TMP-SMX plus doxycycline for 20 weeks (1:1; block size of ten, stratified by study site). We followed patients up every 4 months for 1 year and annually thereafter to the end of the study. The primary endpoint was culture-confirmed recurrent melioidosis, and the non-inferiority margin was a hazard ratio (HR) of 1.7. This study is registered with www.controlled-trials.com, number ISRCTN86140460. FINDINGS We enrolled and randomly assigned 626 patients: 311 to TMP-SMX plus placebo and 315 to TMP-SMX plus doxycycline. 16 patients (5%) in the TMP-SMX plus placebo group and 21 patients (7%) in the TMP-SMX plus doxycycline group developed culture-confirmed recurrent melioidosis (HR 0.81; 95% CI 0.42-1.55). The criterion for non-inferiority was met (p=0.01). Adverse drug reactions were less common in the TMP-SMX plus placebo group than in the TMP-SMX plus doxycycline group (122 [39%] vs 167 [53%]). INTERPRETATION Our findings suggest that TMP-SMX is not inferior to TMP-SMX plus doxycycline for the oral phase of melioidosis treatment, and is preferable on the basis of safety and tolerance by patients. FUNDING Thailand Research Fund, the Melioidosis Research Center, the Center of Excellence in Specific Health Problems in Greater Mekong Sub-region cluster, and the Wellcome Trust.