Objective: Theory of mind (ToM) is a complex, high-level cognitive function that allows people to infer the cognitive and affective mental states of others. Previous studies have produced limited and frequently contradictory findings on the neuropsychological underpinnings of ToM performance in patients with stroke. The aim of the present study is to investigate neuropsychological mechanisms of cognitive and affective theory of mind dysfunctions in patients with stroke. Method: Fifty-eight patients with stroke and 22 healthy controls matched in age, gender, and education level underwent robust neuropsychological examination of their pragmatic abilities, executive functions, attention, memory, psychomotor speed, and visuospatial abilities as well as a cognitive and affective ToM assessment. Results: Patients with stroke demonstrated impaired performance in all ToM tasks. While pragmatic competence and, to a lesser degree, executive functions had the strongest contribution to ToM impairments, attention and general cognitive functioning did not directly affect mentalizing abilities, as demonstrated by a path analysis. Our study reveals the different roles of cognitive functions in cognitive and affective components of ToM. Executive functions contributed only to the cognitive components of ToM. Conclusion: Deficits in cognitive aspects of ToM are best explained by impairment of pragmatic competence and executive functions. In contrast, executive dysfunction does not affect the ability to understand the affective mental states of others.