A hybrid blocked and event-related functional magnetic resonance imaging (fMRI) study decomposed brain activity during task switching into sustained and transient components. Contrasting task-switching blocks against single-task blocks revealed sustained activation in right anterior prefrontal cortex (PFC). Contrasting task-switch trials against task-repeat and single-task trials revealed activation in left lateral PFC and left superior parietal cortex. In both sets of regions, activation dynamics were strongly modulated by trial-by-trial fluctuations in response speed. In addition, right anterior PFC; activity selectively covaried with the magnitude of mixing cost (i.e., task-repeat versus single-task trial performance), and left superior parietal activity selectively covaried with the magnitude of the switching cost (i.e., task-switch versus task-repeat trial performance). These results indicate a functional double dissociation in brain regions supporting different components of cognitive control during task switching and suggest that both sustained and transient control processes mediate the behavioral performance costs of task switching.