This study investigates the longitudinal relationship between middle school students' perceived experiences of discrimination and their teacher-student relationship using the Gyeonggi Education Panel Study (GEPS) data. Using an autoregressive cross-lagged model, it examines (a) how middle school students' experiences of discrimination from the first grade through the third grade and their relationship with teachers change, (b) how the experiences of discrimination affect the teacher-student relationship afterwards and vice versa. Finally, it also examines the moderating effect of innovative schools by using a multigroup analysis. The main findings are as follows. First, an experience of discrimination has a positive effect on a following experience of discrimination, but it has a negative effect on the teacher-student relationship. Second, while a positive early teacher-student relationship has a positive effect on the later teacher-student relationship, it has a negative effect on a later experience of discrimination. This shows a cross-lagged effect between experiences of discrimination and the teacher-student relationship. Third, the moderating effect of innovative schools in the longitudinal interaction between disciplinary experience and the teacher-student relationship is not confirmed. Based on these findings, we suggest that teachers try to reduce and mediate discrimination and build good relationships with their students, and that relevant policy support be provided.