This work attempted to clarify the interaction of cognition and pain sensitization during a paradigm of Temporal Summation of Second Pain (TSSP). We analyzed pain ratings and electroencephalographic (EEG) activity obtained from 21 healthy participants during the presentation of four experimental conditions that differed in the manipulation of attention to painful stimuli or working memory load (Attention to hand & TSSP; 0-back & TSSP (low cognitive load); 2-back & TSSP (high cognitive load); 2-back (without pain)). We found that the TSSP was reduced when the attention was diverted and the cognitive load increased, and this reduction was accompanied by higher midfrontal theta activity and lower posterior alpha and central beta activity. Although it is well established that TSSP is a phenomenon that occurs at the spinal level, here we show that it is also affected by supraspinal attentional mechanisms. Delivery of painful repeated stimuli did not affect the performance of the 2-back task but was associated with smaller amplitudes of attentional event-related potentials (ERPs) after standard stimuli (not the target). The study of brain activity during TSSP allowed to clarify the role of top-down attentional modulation in pain sensitization processes. Results contribute to a better understanding of cognitive dysfunction in pain conditions and reinforce the use of therapeutic strategies based on distracting attention away from pain.