This study examined how high school students' attitudes toward advanced physics were predicted by their sense of school belonging, and how gender moderated this relationship. The Trends in International Math and Science (TIMSS) 2015 Advanced data, consisting of responses from 12th grade students enrolled in advanced physics courses among nine countries were used for analysis. Results indicated that students' sense of school belonging significantly predicted the extent that students liked learning advanced physics and their valuing of advanced physics and, among Lebanese students, it was the most important predictor. Additionally, the relationship between students' sense of school belonging and liking advanced physics was stronger for males than for females in Norway and Sweden, while the relationship between the sense of school belonging and valuing advanced physics was stronger for males than females in France and Sweden.