Introduction: TMS is said to be an effective technique for motor and cognitive rehabilitation for acquired neurological lesions. This study aims to evaluate the effect of TMS in the cognition of patients after stroke. Methods: This prospective, longitudinal and interventional study was approved by the Ethics Committee (Protocol No. 54977216.3.0000.5078) and included 16 stroke victims aged from 24 to 74 years. The Montreal Cognitive Assessment (MoCA) test was used before and after the stimulation sessions and TMS was administered according to treatment protocols for a motor goal, with inhibitory (1 hz) TMS stimulation over the right and left primary motor cortex; and according to protocol for the prefrontal cortex involved in humor processing, with stimulation (10 hz) of the left dorsolateral prefrontal cortex, and inhibitory (1 hz) stimulation of the right dorsolateral prefrontal cortex. The patients underwent fifteen treatment sessions, on average. Results: Memory subtests showed improvement, and average and standard deviation values for the pre- and post-intervention periods were [2.06 (1.6) and 3.5 (1.5)], respectively. In terms of total performance, MoCA results were [18.7(3.4) and 21.1(4.03)]. Student’s t test indicated p=0.006 for performance differences in memory and p=0.003 for total performance. Conclusion: TMS was shown to be effective in achieving cognitive rehabilitation after strokes, most notably in terms of the recovery of mnemonic functions