Using event-related potentials (ERPs), we investigated the effects of passive heat stress and recovery on the human cognitive function with Flanker tasks, involving congruent and incongruent stimuli. We hypothesized that modulation of the peak amplitude and latency of the P300 component in ERP waveforms would differ with task difficulty during passive heat stress and recovery. Subjects performed the Flanker tasks before (Pre), at the end of whole body heating (Heat: internal temperature increase of ~1.2°C from the pre-heat baseline), and after the internal temperature had returned to the pre-heat baseline (Recovery). The internal temperature was regulated by a tube-lined suit by perfusing 50°C water for heat stress and 25°C water for recovery immediately after the heat stress. Regardless of task difficulty, the reaction time (RT) was shortened during Heat rather than Pre and Recovery, and standard deviations of RT (i.e., response variability) were significantly smaller during Heat than Pre. However, the peak amplitudes of the P300 component in ERPs, which involved selective attention, expectancy, and memory updating, were significantly smaller during Heat than during Pre, suggesting the impairment of neural activity in cognitive function. Notably, the peak amplitudes of the P300 component were higher during Recovery than during Heat, indicating that the impaired neural activity had recovered after sufficient whole-body cooling. An indicator of the stimulus classification/evaluation time (peak latency of P300) and the RT were shortened during Heat stress, but such shortening was not noted after whole-body cooling. These results suggest that hyperthermia affects the human cognitive function, reflected by the peak amplitude and latency of the P300 component in ERPs during the Flanker tasks, but sufficient treatment such as whole-body cooling performed in this study can recover those functions.