BackgroundThe prevalence of anxiety among adolescents is relatively high during an epidemic. Studies have reported that family function and perceived stress are important factors affecting adolescents’ anxiety. However, only few studies have explored the factors influencing the relationship between family function and anxiety. Therefore, this study explored the mediating and moderating mechanisms underlying this relationship among junior school student during the COVID-19 pandemic.Methods745 junior school students completed family function, perceived stress, and anxiety questionnaires.Results(1) The junior school students that were left-behind tended to show lower family function (t= −4.21,p< 0.001), greater perceived stress (t= 2.72,p< 0.01), and higher anxiety (t= 4.24,p< 0.001), (2) Family function in junior school students was negatively associated with anxiety (r= −0.35,p< 0.001); perceived stress mediated the relationship between family function and anxiety (p< 0.001), and (3) Whether the student was left-behind (LB) moderated the link between family function and anxiety (β= −0.16,t= −3.33,p< 0.001) and between family function and perceived stress (β= −0.22,t= −2.61,p< 0.001).ConclusionThese findings suggest a negative association between family function and anxiety. Knowledge of the mediating role of perceived stress and moderating role of being left-behind may help prevent and improve anxiety among junior school students during the COVID-19 pandemic.