The WHO End TB Strategy requires drug susceptibility testing and treatment of all people with tuberculosis, but second-line diagnostic testing with line-probe assays needs to be done in experienced laboratories with advanced infrastructure. Fewer than half of people with drug-resistant tuberculosis receive appropriate treatment. We assessed the diagnostic accuracy of the rapid Xpert MTB/XDR automated molecular assay (Cepheid, Sunnyvale, CA, USA) to overcome these limitations. We did a prospective study involving individuals presenting with pulmonary tuberculosis symptoms and at least one risk factor for drug resistance in four sites in India (New Delhi and Mumbai), Moldova, and South Africa between July 31, 2019, and March 21, 2020. The Xpert MTB/XDR assay was used as a reflex test to detect resistance to isoniazid, fluoroquinolones, ethionamide, amikacin, kanamycin, and capreomycin in adults with positive results for Mycobacterium tuberculosis complex on Xpert MTB/RIF or Ultra (Cepheid). Diagnostic performance was assessed against a composite reference standard of phenotypic drug-susceptibility testing and whole-genome sequencing. This study is registered with ClinicalTrials.gov, number NCT03728725. Of 710 participants, 611 (86%) had results from both Xpert MTB/XDR and the reference standard for any drug and were included in analysis. Sensitivity for Xpert MTB/XDR detection of resistance was 94% (460 of 488, 95% CI 92-96) for isoniazid, 94% (222 of 235, 90-96%) for fluoroquinolones, 54% (178 of 328, 50-61) for ethionamide, 73% (60 of 82, 62-81) for amikacin, 86% (181 of 210, 81-91) for kanamycin, and 61% (53 of 87, 49-70) for capreomycin. Specificity was 98-100% for all drugs. Performance was equivalent to that of line-probe assays. The non-determinate rate of Xpert MTB/XDR (ie, invalid M tuberculosis complex detection) was 2·96%. The Xpert MTB/XDR assay showed high diagnostic accuracy and met WHO's minimum target product profile criteria for a next-generation drug susceptibility test. The assay has the potential to diagnose drug-resistant tuberculosis rapidly and accurately and enable optimum treatment. German Federal Ministry of Education and Research through KfW, Dutch Ministry of Foreign Affairs, and Australian Department of Foreign Affairs and Trade.