In the context of the COVID-19 pandemic, students may experience severe learning loss. This study investigated the potential effects of family environment and teacher autonomy support on learning engagement among secondary school students during home-based online learning amidst the COVID-19 pandemic, as well as the underlying mechanisms, including the mediating roles of psychological distress and difficulties in learning motivation. The researchers recruited 2,470 secondary school students in Beijing to complete an online survey. The final sample for analysis included 1937 students with an average age of 15.16 years (SD=1.67 years, range=12.62-18.76 years). Several instruments were used, including the Home Environment Questionnaire for Secondary School Students, the Learning Climate Questionnaire, the Depression Anxiety and Stress Scale, the Middle School Students Learning Motivation Test, and the Utrecht Work Engagement Scale for Students. The results of structural equation modeling revealed the following findings: (1) both the family environment and teacher autonomy support significantly predicted students' learning engagement; (2) difficulties in learning motivation mediated the relationship between the family environment and learning engagement as well as the relationship between teacher autonomy support and learning engagement; and (3) chain mediation effects were established, with psychological distress and difficulties in learning motivation mediated the association between the family environment and learning engagement as well as the association between teacher autonomy support and learning engagement. These findings enhance our understanding of the mechanisms underlying the effects of the family environment and teacher autonomy support on learning engagement, thus providing insights for promoting students' learning engagement, especially during future crises or disasters.