The study aims to examine the relationship between school functioning, physical activity (PA), sex, Body Mass Index (BMI), age, and resilience in Ukrainian children who migrated to Poland due to the war. A cross-sectional study was conducted in 2022, focusing on 248 children aged 10–15 years. The findings suggest that school environment, including enjoyment of school and strong support from teachers, plays a significant role in building resilience in children. PA enhanced the resilience of girls, whereas a higher BMI negatively impacted it. A child-friendly school environment that encourages PA and provides social support could be a promising approach for the mental health of Ukrainian refugee children. © The Author(s) 2024.

DOI: 10.1038/s41598-024-55933-6
ISSN: 20452322