Xpert® MTB/RIF has been widely used for tuberculosis (TB) diagnosis in Brazil, since 2014. This prospective observational study aimed to evaluate the performance of Xpert in different contexts during a two-year period: (i) laboratory and clinical/epidemiological diagnosis; (ii) HIV-positive and -negative populations; (iii) type of specimens: pulmonary and extrapulmonary. Overall, 924 specimens from 743 patients were evaluated. The performance of the assays was evaluated considering culture (Lowenstein Jensen or LJ medium) results and composite reference standard (CRS) classification as gold standard. According to CRS evaluation, 219 cases (29.5%) were classified as positive cases, 157 (21.1%) as ‘possible TB’, and 367 (49.3%) as ‘not TB’. Based on culture, Xpert and AFB smear achieved a sensitivity of 96% and 62%, respectively, while based on CRS, the sensitivities of Xpert, AFB smear, and culture were 40.7%, 20%, and 25%, respectively. The pooled sensitivity and specificity of Xpert were 96% and 94%, respectively. Metric evaluations were similar between pulmonary and extrapulmonary samples against culture, whereas compared to CRS, the sensitivities were 44.6% and 29.3% for the pulmonary and extrapulmonary cases, respectively. The Xpert detected 42/69 (60.9%) patients with confirmed TB and negative culture on LJ medium, and 52/69 (75.4%) patients with negative AFB smear results. There was no significant difference in the diagnostic accuracy based on the types of specimens and population (positive- and negative-HIV). Molecular testing detected 13 cases of TB in culture-negative patients with severe immunosuppression. Resistance to rifampicin was detected in seven samples. Herein, Xpert showed improved detection of pulmonary and extrapulmonary TB cases, both among HIV-positive and -negative patients, even in cases with advanced immunosuppression, thereby performing better than multiple other diagnostic parameters.