Resilience, a pivotal construct in positive psychology, remains incompletely understood in its facilitation of learners' online engagement. This study aims to investigate the relationship between resilience, transactional distance, and Online Mathematics Learning Engagement (OMLE) among first-year university students. Utilizing a cross-lagged path analysis approach, the study surveyed 612 first-year students. Multiple models were constructed and compared to explore the mutual predictive relationships between resilience, transactional distance, and OMLE. Among the compared models, Model 4 demonstrated the best fit. The model revealed that: (1) resilience at Time 1 and Time 2 positively predicted transactional distance at Time 2 and Time 3; (2) transactional distance at Time 1 and Time 2 positively predicted OMLE at Time 2 and Time 3; (3) resilience at Time 1 significantly predicted OMLE at Time 3; and (4) transactional distance at Time 2 fully mediated the relationship between resilience at Time 1 and OMLE at Time 3. Furthermore, mediational model analysis confirmed that transactional distance played a mediating role in the longitudinal relationship between resilience and OMLE. Using a cross-lagged mediational model with 5000 bootstrap samples, the indirect effect of transactional distance on the relationship between resilience at Time 1 and OMLE at Time 3 was significant and remained stable over time. The findings suggest that resilience, as a positive psychological resource, stimulates students to seek and utilize protective resources in online environments, leading to more active participation in interpersonal communication and classroom interactions. Additionally, resilience helps students overcome emotional and practical difficulties encountered in online learning, thereby enhancing their OMLE. These insights offer valuable implications for educators, highlighting the potential to improve students' online learning engagement by fostering their psychological resilience.