Abstract The role of the dorsal prefrontal cortex in working memory remains controversial. Influential proposals include a role in the maintenance of domain-specific information, and the processes of executive functions on remembered information. We used event-related functional magnetic resonance imaging to demonstrate a functional dissociation within prefrontal cortex in terms of the components of complex working memory tasks. The maintenance in working memory of spatial locations and their temporal order was associated with activation of area 8 and intraparietal cortex. In contrast, the selection of one location, according to its order, was associated with a distinct frontoparietal network, including dorsolateral prefrontal area 46, ventrolateral prefrontal cortex and anterior cingulate cortex and medial parietal cortex. The different contributions of these areas to selection are considered in the light of recent electrophysiological and lesion studies. We suggest a general role of the dorsolateral prefrontal area 46 in attentional selection, including selection from within working memory.