Human ability to attend to visual stimuli based on their spatial locations requires the parietal cortex. One hypothesis maintains that parietal cortex controls the voluntary orienting of attention toward a location of interest. Another hypothesis emphasizes its role in reorienting attention toward visual targets appearing at unattended locations. Here, using event-related functional magnetic resonance (ER-fMRI), we show that distinct parietal regions mediated these different attentional processes. Cortical activation occurred primarily in the intraparietal sulcus when a location was attended before visual-target presentation, but in the right temporoparietal junction when the target was detected, particularly at an unattended location.