The purpose of this study was to examine the longitudinal relationship between intrinsic motivation, extrinsic motivation, and engagement based on self-determination theory. The study sample consisted of the 6,550 middle school students in the Korea Education Longitudinal Study (KELS) 2013 panel data from the first year of middle school (grade 7), third year of middle school (grade 9), and second year of high school (grade 11). The results of the autoregressive cross-lagged model are as follows. First, as a result of measuring the self-regression coefficients of intrinsic motivation, extrinsic motivation, and engagement at three time points, it was found that intrinsic motivation, extrinsic motivation, and engagement were stable over time. Second, in the case of the cross-lagged effects of intrinsic motivation and extrinsic motivation, previous intrinsic motivation turned out to have a significant negative effect on extrinsic motivation, and vice versa. Third, intrinsic motivation and extrinsic motivation each showed reciprocal longitudinal effects with engagement. Previous intrinsic motivation turned out to have a significant positive effect on engagement, and vice versa. On the other hand, previous extrinsic motivation turned out to have a significant negative effect on engagement, and vice versa. Finally, the longitudinal relationships between intrinsic motivation, extrinsic motivation, and engagement are discussed.