SummaryBackgroundAs coronavirus disease 2019 (COVID-19) spreads, weak health systems must not become a vehicle for transmission through poor infection prevention and control practices. We assessed the compliance of health workers with infection prevention and control practices relevant to COVID-19 in outpatient settings in Tanzania, before the pandemic.MethodsThis study was based on a secondary analysis of cross-sectional data collected as part of a randomised controlled trial in private for-profit dispensaries and health centres and in faith-based dispensaries, health centres, and hospitals, in 18 regions. We observed provider–patient interactions in outpatient consultation rooms, laboratories, and dressing rooms, and categorised infection prevention and control practices into four domains: hand hygiene, glove use, disinfection of reusable equipment, and waste management. We calculated compliance as the proportion of indications (infection risks) in which a health worker performed a correct action, and examined associations between compliance and health worker and facility characteristics using multilevel mixed-effects logistic regression models.FindingsBetween Feb 7 and April 5, 2018, we visited 228 health facilities, and observed at least one infection prevention and control indication in 220 facilities (118 [54%] dispensaries, 66 [30%] health centres, and 36 [16%] hospitals). 18 710 indications were observed across 734 health workers (49 [7%] medical doctors, 214 [29%] assistant medical officers or clinical officers, 106 [14%] nurses or midwives, 126 [17%] clinical assistants, and 238 [32%] laboratory technicians or assistants). Compliance was 6·9% for hand hygiene (n=8655 indications), 74·8% for glove use (n=4915), 4·8% for disinfection of reusable equipment (n=841), and 43·3% for waste management (n=4299). Facility location was not associated with compliance in any of the infection prevention and control domains. Facility level and ownership were also not significantly associated with compliance, except for waste management. For hand hygiene, nurses and midwives (odds ratio 5·80 [95% CI 3·91–8·61]) and nursing and medical assistants (2·65 [1·67–4·20]) significantly outperformed the reference category of assistant medical officers or clinical officers. For glove use, nurses and midwives (10·06 [6·68–15·13]) and nursing and medical assistants (5·93 [4·05–8·71]) also significantly outperformed the reference category. Laboratory technicians performed significantly better in glove use (11·95 [8·98–15·89]), but significantly worse in hand hygiene (0·27 [0·17–0·43]) and waste management (0·25 [0·14–0·44] than the reference category. Health worker age was negatively associated with correct glove use and female health workers were more likely to comply with hand hygiene.InterpretationHealth worker infection prevention and control compliance, particularly for hand hygiene and disinfection, was inadequate in these outpatient settings. Improvements in provision of supplies and health worker behaviours are urgently needed in the face of the current pandemic.FundingUK Medical Research Council, Economic and Social Research Council, Department for International Development, Global Challenges Research Fund, Wellcome Trust.