Using event-related functional magnetic resonance imaging (fMRI) we determined how brain activity changes when an attended target shifts its location. In the main experiment, a white square could appear at 10 possible eccentricities along the horizontal meridian. It remained on the screen for a variable period of time and then changed location. At any time the stimulus could dim briefly. Subjects had to press a button when the stimulus dimmed. In order to perform this task attention had to be locked onto the target and shift with it. Half of the runs were performed overtly and half covertly. The event of interest consisted of the shift in the location of the attentional target. The state of maintained attention occurring in between the shifts constituted the baseline. The superior parietal gyrus was activated bilaterally in response to attentional shifts. No other area showed a significant response to shifting. On the left side the amplitude of the superior parietal response correlated positively with the distance of the shift. On the right side a significant correlation was present only for overt shifts. In a separate experiment we compared the maintaining of attention at a single spatial location to passive fixation: the frontal eye fields, anterior cingulate, right dorsolateral prefrontal cortex, and inferior parietal lobule were significantly activated, indicating that the absence of a shift-related response in these areas in the main experiment was due to the fact that they were equally activated by maintaining and shifting attention. The response to spatial shifts and the correlation with the distance between the original and the new location points to a specific role of the superior parietal gyrus in shifting the locus of spatial attention.