Background: WHO recommends that Xpert MTB/RIF replaces smear microscopy for initial diagnosis of suspected HIV-associated tuberculosis or multidrug-resistant pulmonary tuberculosis, but no data exist for its use in children. We aimed to assess the accuracy of the test for the diagnosis of pulmonary tuberculosis in children in an area with high tuberculosis and HIV prevalences. Methods: In this prospective, descriptive study, we enrolled children aged 15 years or younger who had been admitted to one of two hospitals in Cape Town, South Africa, with suspected pulmonary tuberculosis between Feb 19, 2009, and Nov 30, 2010. We compared the diagnostic accuracy of MTB/RIF and concentrated, fluorescent acid-fast smear with a reference standard of liquid culture from two sequential induced sputum specimens (primary analysis). Results: 452 children (median age 19·4 months, IQR 11·1-46·2) had at least one induced sputum specimen; 108 children (24%) had HIV infection. 27 children (6%) had a positive smear result, 70 (16%) had a positive culture result, and 58 (13%) had a positive MTB/RIF test result. With mycobacterial culture as the reference standard, MTB/RIF tests when done on two induced sputum samples detected twice as many cases (75·9%, 95% CI 64·5-87·2) as did smear microscopy (37·9%, 25·1-50·8), detecting all of 22 smear-positive cases and 22 of 36 (61·1%, 44·4-77·8) smear-negative cases. For smear-negative cases, the incremental increase in sensitivity from testing a second specimen was 27·8% for MTB/RIF, compared with 13·8% for culture. The specificity of MTB/RIF was 98·8% (97·6-99·9). MTB/RIF results were available in median 1 day (IQR 0-4) compared with median 12 days (9-17) for culture (p<0·0001). Interpretation: MTB/RIF testing of two induced sputum specimens is warranted as the first-line diagnostic test for children with suspected pulmonary tuberculosis.