Using high-frequency proxies for economic activity over a large sample of countries, we show that the economic crisis during the first seven months of the COVID-19 pandemic was only partly due to government lockdowns. Economic activity also contracted because of voluntary social distancing in response to higher infections. We also show that lockdowns can substantially reduce COVID-19 infections, especially if they are introduced early in a country's epidemic. Despite involving short-term economic costs, lockdowns may thus pave the way to a faster recovery by containing the spread of the virus and reducing voluntary social distancing. Finally, we document that lockdowns entail decreasing marginal economic costs but increasing marginal benefits in reducing infections. This suggests that tight short-lived lockdowns are preferable to mild prolonged measures.