BackgroundIllicit drug use results in considerable global morbidity, but there is little data on its trends and factors associated with it in sub-Saharan Africa. We consider these questions using national data from South Africa for 2002–2017. MethodsWe analysed data among individuals aged 15 years or older from five national population-based household surveys in South Africa (2002–2017; n = 89,113). Recent drug use was defined as the last three-months use of illicit drugs, i.e., any use of cannabis, cocaine, amphetamine, inhalants, sedatives, hallucinogens, opioids, and/or other illicit drugs. Time trends in recent drug use were assessed using logistic regression. Multivariable logistic regression assessed the association between recent drug use and socio-demographic factors and between drug use and sexual risk behaviours, HIV-related and other well-being variables. ResultsThe prevalence of recent drug use increased from 1·5% to 10·0% from 2002 to 2017, driven by increases in cannabis use (1·5% to 7·8%) and use of opioids (0·01% to 1·6%), cocaine (0·02% to 1·8%), or amphetamines (0·1% to 1·5%). In adjusted analyses, male gender, younger age, living in urban areas, mixed-ancestry or white ethnicity (compared to black-African), and unemployment were positively associated with recent drug use. Recent drug use was associated with: multiple sexual partners (adjusted odds ratio [aOR] 2·13, 95% confidence interval [CI]: 1·80–2·51); sexual debut before 15 years old (aOR 1·70, 95%CI: 1·29–2·23); hazardous/harmful alcohol use (aOR 2·50, 95%CI: 2·14–2·93) or alcohol dependence (aOR 3·33, 95%CI 2·92–3·80); ever experiencing intimate partner violence (aOR 1·56, 95%CI 1·12–2·17); psychological distress (aOR 1·53, 95%CI: 1·28–1·82); and lower chance of ever testing for HIV (aOR 0·89, 95%CI 0·80–1·00). Recent drug use was not associated with HIV positivity, condom use or being on antiretroviral therapy. ConclusionIllicit drug use has increased substantially in South Africa and is associated with numerous socio-demographic characteristics, higher sexual risk behaviours and other well-being variables.