Abstract: Introduction: Covid-19 lockdown has caused important changes in children's routines, especially in terms of nutrition, physical activity, screen time, social activity, and school time. Regarding these changes, recent studies show that Covid-19 lockdown was associated with higher levels of anxiety and depression in children. The objective of this study was to assess changes in sleep quality in Spanish children during lockdown decreed by the Spanish government between March and June 2020. Methodology: We compared the BEAR score of 478 participants in the SENDO project at the periods before, during and after lockdown. We used hierarchical models with two levels of clustering to account for the intra-cluster correlation between siblings. Interaction of time with and a set of a priori selected variables was assessed by introducing the interaction term into the model and calculating the likelihood ratio test. Results: Mean scores in the BEAR questionnaire referred to the periods before, during, and after lockdown were 0.52 (sd 1.25), 1.43 (sd 1.99) and 1.07 (sd 1.55), respectively, showing a worsening of sleep quality as a result of confinement. Parental level of education was found to be an effect modifier (p for interaction=0.004). Children whose parents had higher education (university graduates or higher) showed a smaller worsening than those without. Conclusion: We found that the mean score in the BEAR questionnaire significantly worsened during lockdown and significantly improved after it. However, it did not reach the initial level. The mean score in the BEAR questionnaire referred to the period after lockdown was significantly higher than before.