The outbreak of COVID-19 has forced implementation of safety measures, leading to changes in people's lives. This study investigated several dietary habits among Romanian children before and during the pandemic. Also, it assessed the effectiveness of an educational program promoting healthy diet and evaluated factors influencing certain eating habits. A longitudinal study was conducted in schools. Students were assigned to Control and Intervention groups. Data were collected at baseline (T1) (October -November 2019, 880 children) and post-intervention (T2) (December 2020-February 2021, 484 students). 350 children participated in both assessments. Baseline measurements revealed inadequate consumptions of fruits, vegetables, dairy products, and increased intake of soft drinks and sweets. At follow-up, the Intervention showed significant improvements on average intake of fruits and vegetables and in children eating ≥ 5 servings/day, compared to its baseline. Regarding self-perceptions on dietary habits during confinement, children from both groups reported healthier behaviors, with a significant decrease of comfort food. Compared to the Control group, Intervention increased its average intake of fruits and vegetables, consumed more ≥ 5 portions/day, reduced the number ≥ 2 cups/day of carbonated beverages and ≥ 3 portions/day of sweets. Age, gender, weight management, body mass index were associated with dietary habits at T1. Age, gender, Intervention group, weight management influenced eating patterns at T2. Eating behaviors at T1 influenced dietary habits at T2. Our program demonstrated positive changes in students' dietary habits, despite challenges of COVID-19. Results highlight the role of health education and emphasize the importance of integrating such programs consistently in schools.