Based on a nationwide micro-survey in China from 2018 to 2021, this paper empirically estimates the causal impact of the COVID-19 pandemic on the mental health of Chinese residents, by exploiting the distribution of the outflow population from Wuhan as an instrumental variable (IV). Our findings suggest that for every 10% increase in the cumulative confirmed cases, the number of mentally unhealthy days reported by urban residents in the past 30 days will increase by 2.19, an increase of 46.90% compared with the mean value. The impact is more significant among females, people aged 30 or above, and private-sector employees. Further evidence highlights the negative impact of the COVID-19 pandemic on residents’ expectations of future income and confidence in macroeconomic development, both of which we interpret as mechanisms related to economic concerns. In addition, application of the multi-period difference-in-differences (DID) strategy revealed that the negative impact still exists two years post-pandemic, but it has been dramatically alleviated since the initial stage.