The relationship between individual and school factors plays a crucial role in shaping adolescents' mathematics achievement. Individual factors, such as a student's motivation and educational expectation, directly influence their engagement and persistence in mathematical learning. Concurrently, school factors, including teacher quality and the availability of resources, create an environment that either fosters or hinders students' academic success in mathematics. Together, these factors underscore the need for a holistic approach to education that recognizes the interconnectedness of personal and institutional influences on student performance. Thus, this study investigates what individual and school factors have been associated with adolescents’ mathematics achievement over the last two decades. We examined six-wave data of Malaysia from the Trends in International Mathematics and Science Study (TIMSS). Multilevel modeling technique was employed for data composed of 5557, 5314, 4466, 5733, 9726, and 7065 eighth-grade students participating in 1999, 2003, 2007, 2011, 2015, and 2019, respectively. The results showed that 65.17%, 57.44%, 65.89%, 73.00%, 43.16%, and 61.69% of the total variance in mathematics achievement was due to school differences in these years. The findings also indicated that students with higher mathematics motivational beliefs scored higher. Students who more frequently spoke the language of the test at home achieved lower scores in the four waves of TIMSS; however, this trend changed in 2015 and 2019. Student educational aspiration emerged as a positive predictor of mathematics achievement in the last two assessments of TIMSS. Home educational resources and book ownership also significantly correlated with mathematics achievement. At the school level, teacher gender was negatively associated with achievement in all TIMSS waves except 2019. Students whom female teachers taught outperformed those whom male teachers taught. The longitudinal study of Malaysian students' mathematics performance reveals critical insights for educational stakeholders. The findings indicate that 43.16% to 73.00% of the variance in mathematical achievement is linked to school differences, underscoring the importance of equitable resource distribution. Moreover, students' motivational beliefs significantly influence their mathematics scores, suggesting a need for interventions that foster positive attitudes. The evolving correlation between home language proficiency and achievement emphasizes the necessity of integrating language support into educational strategies. Additionally, promoting educational aspirations is vital for enhancing performance, while the role of gender dynamics in teacher effectiveness warrants further exploration.