Gambling disorder is associated with elevated comorbidity with depressive and anxious disorders, and one variable that might help in the understanding of this association is metacognition. In the present study, the relationship between gambling and metacognition and the mediating role of metacognition in the relationship between gambling and depressive and anxious symptomatology were assessed. The sample comprised 124 pathological gamblers from centers that assist pathological gamblers and 204 participants from the general population. The results showed that pathological gamblers had higher levels of depressive and anxious symptomatology. Additionally, pathological gamblers had higher scores for positive beliefs about worry, negative beliefs of uncontrollability and danger, and beliefs about the need to control thoughts; these factors were also positively correlated with depressive and anxious symptomatology. Metacognition also fully mediated the association between gambling and depressive and anxious symptomatology. These results suggest that metacognition could contribute to explaining gambling disorder and the symptomatology associated with it.