Both cognitive and affective processes require mental resources. However, it remains unclear whether these 2 processes work in parallel or in an integrated fashion. In this functional magnetic resonance imaging study, we investigated their interaction using an empathy-for-pain paradigm, with simultaneous manipulation of cognitive demand of the tasks and emotional valence of the stimuli. Eighteen healthy adult participants viewed photographs showing other people's hands and feet in painful or nonpainful situations while performing tasks of low (body part judgment) and high (laterality judgment) cognitive demand. Behavioral data showed increased reaction times and error rates for painful compared with nonpainful stimuli under laterality judgment relative to body part judgment, indicating an interaction between cognitive demand and stimulus valence. Imaging analyses showed activity in bilateral anterior insula (AI) and primary somatosensory cortex (SI), but not posterior insula, for main effects of cognitive demand and stimulus valence. Importantly, cognitive demand and stimulus valence showed a significant interaction in AI, SI, and regions of the frontoparietal network. These results suggest that cognitive and emotional processes at least partially share common brain networks and that AI might serve as a key node in a brain network subserving cognition-emotion integration.