The interplay of "top-down" and "bottom-up" regulated mechanisms is of particular relevance for the rapid (re-)focusing of attention to environmental changes. The purpose of the study was to explore the differential contributions of frontoparietal attentional networks involved in top-down and stimulus-driven processing to the detection of "target" and "distractor" events in a visual three-stimulus oddball paradigm. Thirteen healthy subjects underwent separate event-related potential (ERP) and whole-brain functional magnetic resonance imaging (fMRI) measurements during the oddball task. The targets, which were difficult to detect, elicited a classical posterior P3b whereas the distractor stimuli were followed by a centro-frontal P3a ERP. The fMRI data showed activation of the temporoparietal junction (TPJ) bilaterally and right prefrontal cortex associated with both the target and distractor conditions. This network has previously been described as an attentional system that is predominantly stimulus driven and that responds to rare events. Furthermore, target processing produced bilateral perisylvian activity, which has been related to the "retrieval mode". Processing of the distractors activated the frontal eye fields (FEFs) and bilateral superior parietal cortex, areas engaged in attention switching and voluntary allocation of attention. Additional left prefrontal activation suggested an involvement: of the cortical system for working memory encoding. Our results thus demonstrate that distractor and target processing engage a common neuronal system for the detection of rare events, but also task-specific subsystems related to attention and memory processes.