Although depression has been linked to the habit of consuming sugar-sweetened beverages (SSBs), little is known about their long-term relationships and the mediating role of sleep problems. This study examines the associations between childhood depressive symptoms trajectories and adolescent SSB-habit trajectories and whether these associations were mediated by sleep problems. Data came from 1560 adolescents participating in a longitudinal study across grades 1 through 12 in northern Taiwan. Group-based trajectory modeling was used to identify development of childhood depressive symptoms and an SSB habit in adolescence. Multinomial logistic regression was conducted to examine the influence of childhood depressive symptoms and adolescent SSB habit. Mediation analysis was conducted to test whether sleep problems mediated the associations examined. Four distinct trajectories of childhood depressive symptoms were identified: low-stable (30.79%), moderate-stable (42.32%), increasing (12.29%), and high-stable (11.60%). Three distinct trajectories of SSBs habit in adolescence were identified: low-stable (44.32%), increasing (15.02%), and high-stable (40.65%). Children who had moderate-stable (aO = 1.35; CI: 1.04-1.77), high-stable (aOR = 2.01; CI: 1.28-3.15), or increasing (aOR = 1.97; CI: 1.26-3.06) trajectories of depressive symptoms relative to those in the low-stable group were significantly more likely to belong to the high-stable trajectory of SSBs than to the low-stable SSBs group. The Z-mediation test showed that sleep problems significantly mediated the associations between trajectories of childhood depressive symptoms and trajectories of SSBs during adolescence (all p < 0.05). Childhood depressive symptoms conferred risks for adolescent SSB habits; and the effects were seen, in part, through increasing sleep problems.