BACKGROUND: Global control of tuberculosis is hampered by slow, insensitive diagnostic methods, particularly for the detection of drug-resistant forms and in patients with human immunodeficiency virus infection. Early detection is essential to reduce the death rate and interrupt transmission, but the complexity and infrastructure needs of sensitive methods limit their accessibility and effect. METHODS: We assessed the performance of Xpert MTB/RIF, an automated molecular test for Mycobacterium tuberculosis (MTB) and resistance to rifampin (RIF), with fully integrated sample processing in 1730 patients with suspected drug-sensitive or multidrug-resistant pulmonary tuberculosis. Eligible patients in Peru, Azerbaijan, South Africa, and India provided three sputum specimens each. Two specimens were processed with N-acetyl-L-cysteine and sodium hydroxide before microscopy, solid and liquid culture, and the MTB/RIF test, and one specimen was used for direct testing with microscopy and the MTB/RIF test. RESULTS: Among culture-positive patients, a single, direct MTB/RIF test identified 551 of 561 patients with smear-positive tuberculosis (98.2%) and 124 of 171 with smear-negative tuberculosis (72.5%). The test was specific in 604 of 609 patients without tuberculosis (99.2%). Among patients with smear-negative, culture-positive tuberculosis, the addition of a second MTB/RIF test increased sensitivity by 12.6 percentage points and a third by 5.1 percentage points, to a total of 90.2%. As compared with phenotypic drug-susceptibility testing, MTB/RIF testing correctly identified 200 of 205 patients (97.6%) with rifampin-resistant bacteria and 504 of 514 (98.1%) with rifampin-sensitive bacteria. Sequencing resolved all but two cases in favor of the MTB/RIF assay. CONCLUSIONS: The MTB/RIF test provided sensitive detection of tuberculosis and rifampin resistance directly from untreated sputum in less than 2 hours with minimal hands-on time. (Funded by the Foundation for Innovative New Diagnostics.).