There is a paucity of longitudinal investigations of gambling behavior in the transition from adolescence to emerging adulthood. We conducted a longitudinal investigation of the associations and patterns of change between mental health symptoms and gambling behavior. A representative sample of Norwegians completed questionnaires containing demographic, mental health, and gambling measures at age 17 (N = 2055), and at ages 18 (N = 1334) and 19 (N = 1277). Using latent class analysis, three classes of gambling behavior were identified: consistent non-gambling (71.1%), consistent non-risk gambling (23.8%), and risky-and-problem gambling (5.1%). Being male, showing higher physical and verbal aggression and having more symptoms of depression were associated with greater odds of belonging to the risky-and-problem gambling class at age 17. Overall, the risky-and-problem gambling class had the highest physical and verbal aggression, anxiety, and depression at 19 years. Our findings elucidate the reciprocal relationship between mental health and gambling behavior in the transition from adolescence to emerging adulthood, and the importance of recognizing these factors in designing targeted interventions.