Identifying structural breaks in the dynamics of COVID-19 contagion is crucial to promptly assess policies and evaluate the effectiveness of lockdown measures. However, official data record infections after a critical and unpredictable delay. Moreover, people react to the health risks of the virus and also anticipate lockdowns. All of this makes it complex to quickly and accurately detect changing patterns in the virus’s infection dynamic. We propose a machine learning procedure to identify structural breaks in the time series of COVID-19 cases. We consider the case of Italy, an early-affected country that was unprepared for the situation, and detect the dates of structural breaks induced by three national lockdowns so as to evaluate their effects and identify some related policy issues. The strong but significantly delayed effect of the first lockdown suggests a relevant announcement effect. In contrast, the last lockdown had significantly less impact. The proposed methodology is robust as a real-time procedure for early detection of the structural breaks: the impact of the first two lockdowns could have been correctly identified just the day after they actually occurred.