The primary objective of this study is to explore the interrelation between motivation, self-efficacy, and behavioral engagement in primary school mathematics learning. This study also examines the mediating role of self-efficacy in the relationship between motivation and behavioral engagement. The research involved 660 fifth and sixth grade students in four schools in Surabaya, Indonesia. The data collected was analyzed using structural equation modeling. The study revealed that motivation is key to enhancing students’ self-efficacy and behavioral engagement during mathematics learning. Additionally, self-efficacy was found to be linked with students’ behavioral engagement. Furthermore, self-efficacy was identified as a mediator in the relationship between motivation toward mathematics and behavioral engagement during mathematics learning. The study provides valuable insights into these variables in the Indonesian context, particularly in elementary schools for mathematics learning. The research also discusses the implications of the study for teaching practices.