Introduction: Being able to understand other people's emotions and intentions is crucial for social interactions and well-being. Deficits in theory of mind (ToM) functioning hamper this ability and have been observed in depression and other neuropsychiatric disorders. However, results of previous research in depression have been inconclusive, possibly due to the presence of comorbid disorders and the disregarding of other modulating factors. Methods: Thirty-eight patients with a major depressive disorder (MDD) and forty healthy matched controls were assessed with a ToM task using animated triangles. Results were correlated with attachment styles, empathy abilities and neurocognitive performance. Results: Our findings show that 1) healthy female controls performed significantly stronger on the ToM task than female MDD patients, 2) these performance differences were driven by attachment styles and 3) depression severity did not impact task performance. Limitations: The pharmacological treatment of the majority of patients might limit the generalizability of this study. Discussion: Results indicate a gender-specific impact of attachment styles on ToM performance. Future studies should investigate whether impairments in social cognitive tasks pose a risk factor for depression and/or interactional styles or vice versa. Moreover, with regard to remediation programs gender-specific needs should be taken into account.