Background Tuberculosis, often undiagnosed, is the major cause of death among HIV-positive people. We tested an algorithm enabling nurses in South African primary healthcare clinics (PHCs) to initiate empirical tuberculosis treatment among adults with advanced HIV disease. Methods In an open-label cluster-randomised trial, 24 PHCs were randomised 1:1 to intervention or control (routine care) using computer-generated random numbers. HIV-positive adults were eligible if they had CD4 count ≤150 cells per µL; no antiretroviral therapy (ART) or tuberculosis treatment in the last six or three months respectively; and did not require urgent hospital referral. In intervention clinics, study nurses assessed participants based on tuberculosis symptoms, body mass index (BMI), pointof-care haemoglobin, and urine lipoarabinomannan assay (Determine TB-LAM, Alere). A study algorithm assigned tuberculosis probability as high (positive urine TB-LAM or BMI <18•5 kg/m 2 or haemoglobin <100 g/L), to start tuberculosis treatment immediately then ART two weeks later; medium (tuberculosis symptoms, no high probability criteria), to have symptom-guided investigation; or low (no tuberculosis symptoms or high probability criteria), to start ART immediately. The primary outcome was all-cause mortality at six months. (ISRCTN35344604) Findings 3091 individuals were screened; 3053 assigned a study identifier; and 3022 (1507 intervention, 1515 control; median age 37 years, 55•2% female, median CD4 72 cells per µL) analysed. 930/1507 (61•7%) versus 172/1515 (11•4%) of participants in the intervention versus control arm started tuberculosis treatment by two months. The mortality rate was 19•0 (134 deaths/704 person-years [pyrs]) versus 21•6 (151/699 pyrs) per 100 pyrs in the intervention versus control arm (unadjusted hazard ratio [HR] 0•92, 95% CI 0•67-1•26; adjusted HR 0•87, 95% CI 0•61-1•24, p=0•41). There were 29 versus 11 serious or severe adverse events in the intervention versus control arm. 4 Interpretation Our intervention substantially increased coverage of tuberculosis treatment in this high-risk population, but did not reduce mortality.