SummaryBackgroundQuality of care is consistently shown to be inadequate in health-care settings in many low-income and middle-income countries, including in private facilities, which are rapidly growing in number but often do not have effective quality stewardship mechanisms. The SafeCare programme aims to address this gap in quality of care, using a standards-based approach adapted to low-resource settings, involving assessments, mentoring, training, and access to loans, to improve clinical quality and facility business performance. We assessed the effect of the SafeCare programme on quality of patient care in faith-based and private for-profit facilities in Tanzania.MethodsIn this cluster-randomised controlled trial, health facilities were eligible if they were dispensaries, health centres, or hospitals in the faith-based or private for-profit sectors in Tanzania. We randomly assigned facilities (1:1) using computer-generated stratified randomisation to receive the full SafeCare package (intervention) or an assessment only (control). Implementing staff and participants were masked to outcome measurement and the primary outcomes were measured by fieldworkers who had no knowledge of the study group allocation. The primary outcomes were health worker compliance with infection prevention and control (IPC) practices as measured by observation of provider–patient interactions, and correct case management of undercover standardised patients at endline (after a minimum of 18 months). Analyses were by modified intention to treat. The trial is registered with ISRCTN, ISRCTN93644888.FindingsBetween March 7 and Nov 30, 2016, we enrolled and randomly assigned 237 health facilities to the intervention (n=118) or control (n=119). Nine facilities (seven intervention facilities and two control facilities) closed during the trial and were not included in the analysis. We observed 29 608 IPC indications in 5425 provider–patient interactions between Feb 7 and April 5, 2018. Health facilities received visits from 909 standardised patients between May 3 and June 12, 2018. Intervention facilities had a 4·4 percentage point (95% CI 0·9–7·7; p=0.015) higher mean SafeCare standards assessment score at endline than control facilities. However, there was no evidence of a difference in clinical quality between intervention and control groups at endline. Compliance with IPC practices was observed in 8181 (56·9%) of 14 366 indications in intervention facilities and 8336 (54·7%) of 15 242 indications in control facilities (absolute difference 2·2 percentage points, 95% CI −0·2 to −4·7; p=0·071). Correct management occurred in 120 (27·0%) of 444 standardised patients in the intervention group and in 136 (29·2%) of 465 in the control group (absolute difference −2·8 percentage points, 95% CI −8·6 to −3·1; p=0·36).InterpretationSafeCare did not improve clinical quality as assessed by compliance with IPC practices and correct case management. The absence of effect on clinical quality could reflect a combination of insufficient intervention intensity, insufficient links between structural quality and care processes, scarcity of resources for quality improvement, and inadequate financial and regulatory incentives for improvement.FundingUK Health Systems Research Initiative (Medical Research Council, Economic and Social Research Council, UK Department for International Development, Global Challenges Research Fund, and Wellcome Trust).