Lockdowns to control the spread of the coronavirus disease 2019 (COVID-19) have had profound effects on everyday life worldwide, but their effect on mental health remains unclear because available meta-analyses and reviews rely mostly on cross-sectional studies. We conducted a rapid review and meta-analysis of longitudinal studies and natural experiments investigating the relationship between COVID-19 lockdowns and mental health. A total of 25 studies involving 72 004 participants and 58 effect sizes were analyzed. Using a random effects model, we found that lockdowns had small effects on mental health symptoms, g = 0.17, s.e. = 0.05, 95% CI (0.06–0.24), p = 0.001, but the effects on positive psychological functioning, g = −0.12, s.e. = 0.11, 95% CI (−0.33 to 0.09), p = 0.27, were not significant. Multivariate analysis of effect sizes revealed significant and relatively small effect sizes for anxiety and depression, while those for social support, loneliness, general distress, negative affect, and suicide risk were not significant. The results indicated substantial heterogeneity among studies, but meta-regression analyses found no significant moderation effects for mean age, gender, continent, COVID-19 death rate, days of lockdown, publication status or study design. The psychological impact of COVID-19 lockdowns is small in magnitude and highly heterogeneous, suggesting that lockdowns do not have uniformly detrimental effects on mental health and that most people are psychologically resilient to their effects.